This makes git-am to record the expected HEAD location after
finishing its operation in the index, so that subsequent BASE
check would notice when somebody else updated your branch head
while you are looking the other way.
Signed-off-by: Junio C Hamano <redacted>
---
git-am.sh | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/git-am.sh b/git-am.sh
index e69ecbf..27912ce 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -13,6 +13,7 @@ git var GIT_COMMITTER_IDENT >/dev/null || exit
stop_here () {
echo "$1" >"$dotest/next"
+ git update-index --set-base $(git rev-parse --verify HEAD)
exit 1
}
@@ -157,6 +158,8 @@ do
esac
done
+check_base || exit
+
# If the dotest directory exists, but we have finished applying all the
# patches in them, clear it out.
if test -d "$dotest" &&
@@ -468,5 +471,6 @@ do
go_next
done
+git update-index --set-base $(git rev-parse --verify HEAD)
rm -fr "$dotest"
--
1.5.1.730.g0d43be