Reproduce and fix with gc-pull the merge replay problem.
[git-central.git] / scripts / gc-pull
index 1844725..fcde7b9 100644 (file)
@@ -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 <branch>`?
-#
-git pull --rebase $*
+GIT_EDITOR=: git rebase -p -i "origin/$branch_name"