Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix `gup`'s detection of branches containing slashes.

  • Loading branch information...
commit 0519fb2effaa7de6e973cb56a993785b513c197d 1 parent 63cca2c
@jasoncodes authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 _posts/gup-git-rebase.markdown
View
5 _posts/gup-git-rebase.markdown
@@ -34,7 +34,10 @@ function gup
# fetch upstream changes
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)" ]
then
echo "\"$BRANCH\" is not a tracking branch." >&2
Please sign in to comment.
Something went wrong with that request. Please try again.