Reproduce and fix with gc-pull the merge replay problem.
[git-central.git] / scripts / gc-push
index 32952b1..4e72fe5 100644 (file)
@@ -1,6 +1,12 @@
 #!/bin/sh
 
-branch_name=$(git-symbolic-ref HEAD)
+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 push origin $branch_name
 if [[ $? -ne 0 ]] ; then