X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=scripts%2Fgc-pull;h=fcde7b926a7895c27c71132041d3f80e9d0553e5;hb=2cc12dd1e867b34569924d6008972b98ffe353f9;hp=1844725ae05a6bb12d9c0285dfa1168c427286f3;hpb=40ae911acc61e38de4f4e7517b921dc30c9822ea;p=git-central.git diff --git a/scripts/gc-pull b/scripts/gc-pull index 1844725..fcde7b9 100644 --- a/scripts/gc-pull +++ b/scripts/gc-pull @@ -1,7 +1,18 @@ #!/bin/sh +#!/bin/sh + +branch_name=$(git symbolic-ref --quiet HEAD) +if [[ $? -ne 0 ]] ; then + echo "not on a branch" + exit 1 +fi + +branch_name=${branch_name/refs\/heads\//} + +git fetch +if [[ $? -ne 0 ]] ; then + exit $? +fi -# -# Note: we should use `git pull --rebase origin `? -# -git pull --rebase $* +GIT_EDITOR=: git rebase -p -i "origin/$branch_name"