Fix post-receive-email test for USER_EMAIL variable.
[git-central.git] / scripts / gc-pull
index 325eb2d..c2313ba 100644 (file)
@@ -1,4 +1,17 @@
 #!/bin/sh
 
-git pull --rebase
+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
+
+GIT_EDITOR=: git rebase -p -i "origin/$branch_name"