Commit 7238e295 authored by Vincent Driessen's avatar Vincent Driessen

Use a safer, more reliable way of determining what branches are available, by...

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.
parent 377949c1
...@@ -16,8 +16,8 @@ ...@@ -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; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment