Skip to content

Commit

Permalink
Fix gup's detection of branches containing slashes.
Browse files Browse the repository at this point in the history
  • Loading branch information
jasoncodes committed May 1, 2012
1 parent 63cca2c commit 0519fb2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion _posts/gup-git-rebase.markdown
Expand Up @@ -34,7 +34,10 @@ function gup
# fetch upstream changes # fetch upstream changes
git fetch git fetch


BRANCH=$(basename $(git symbolic-ref -q HEAD)) BRANCH=$(git symbolic-ref -q HEAD)
BRANCH=${BRANCH##refs/heads/}
BRANCH=${BRANCH:-HEAD}

if [ -z "$(git config branch.$BRANCH.remote)" -o -z "$(git config branch.$BRANCH.merge)" ] if [ -z "$(git config branch.$BRANCH.remote)" -o -z "$(git config branch.$BRANCH.merge)" ]
then then
echo "\"$BRANCH\" is not a tracking branch." >&2 echo "\"$BRANCH\" is not a tracking branch." >&2
Expand Down

0 comments on commit 0519fb2

Please sign in to comment.