Use a safer, more reliable way of determining what branches are available, by parsing the 'git branch' output instead of depending on files in the FS.
This commit is contained in:
parent
377949c132
commit
7238e29564
1 changed files with 2 additions and 2 deletions
|
@ -16,8 +16,8 @@
|
||||||
GIT_DIR=$(git rev-parse --git-dir)
|
GIT_DIR=$(git rev-parse --git-dir)
|
||||||
|
|
||||||
# Get all available branches
|
# Get all available branches
|
||||||
LOCAL_BRANCHES=$(cd "$GIT_DIR/refs/heads"; find * -type f)
|
LOCAL_BRANCHES=$(git branch | sed 's/^[* ] //')
|
||||||
REMOTE_BRANCHES=$(cd "$GIT_DIR/refs/remotes"; find * -type f)
|
REMOTE_BRANCHES=$(git branch -r | sed 's/^[* ] //')
|
||||||
ALL_BRANCHES="$LOCAL_BRANCHES\n$REMOTE_BRANCHES"
|
ALL_BRANCHES="$LOCAL_BRANCHES\n$REMOTE_BRANCHES"
|
||||||
|
|
||||||
warn() { echo "$@" >&2; }
|
warn() { echo "$@" >&2; }
|
||||||
|
|
Loading…
Reference in a new issue