Teach "am" and "rebase" to mark the original position with ORIG_HEAD
[gitweb.git] / git-am.sh
index b48096ec2037e3f14d4bdf89a0afe4623aff090e..fe53608c94a7eda70aebfdf3364802b1a665647f 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
@@ -241,6 +241,7 @@ else
                : >"$dotest/rebasing"
        else
                : >"$dotest/applying"
+               git update-ref ORIG_HEAD HEAD
        fi
 fi
 
@@ -421,7 +422,7 @@ do
        else
            action=yes
        fi
-       FIRSTLINE=$(head -1 "$dotest/final-commit")
+       FIRSTLINE=$(sed 1q "$dotest/final-commit")
 
        if test $action = skip
        then