mirror of
https://github.com/samsonjs/bin.git
synced 2026-03-25 07:55:47 +00:00
Fix running git-update without any args
This commit is contained in:
parent
8cb24aa2eb
commit
f9062c25cb
1 changed files with 2 additions and 2 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -e # bail on errors
|
set -euo pipefail
|
||||||
|
|
||||||
function current_branch() {
|
function current_branch() {
|
||||||
git rev-parse --abbrev-ref HEAD | sed -e 's/^heads\///'
|
git rev-parse --abbrev-ref HEAD | sed -e 's/^heads\///'
|
||||||
|
|
@ -13,7 +13,7 @@ if [[ "$ORIG_BRANCH" = "HEAD" ]]; then
|
||||||
echo "Cannot update in a detached HEAD state"
|
echo "Cannot update in a detached HEAD state"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if [[ -z "$2" ]]; then
|
if [[ -z "${2:-}" ]]; then
|
||||||
BRANCHES="$ORIG_BRANCH"
|
BRANCHES="$ORIG_BRANCH"
|
||||||
else
|
else
|
||||||
if [[ "$1" = "$REMOTE" ]]; then
|
if [[ "$1" = "$REMOTE" ]]; then
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue