Keep Porcelainish from failing by broken ident after making changes.
[git.git] / git-am.sh
index 731ab1f..85ecada 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
@@ -1,11 +1,13 @@
 #!/bin/sh
 #
-#
+# Copyright (c) 2005, 2006 Junio C Hamano
 
 USAGE='[--signoff] [--dotest=<dir>] [--utf8] [--binary] [--3way] <mbox>
   or, when resuming [--skip | --resolved]'
 . git-sh-setup
 
+git var GIT_COMMITTER_IDENT >/dev/null || exit
+
 stop_here () {
     echo "$1" >"$dotest/next"
     exit 1
@@ -88,6 +90,10 @@ fall_back_3way () {
     # saying that we reverted all those changes.
 
     git-merge-resolve $orig_tree -- HEAD $his_tree || {
+           if test -d "$GIT_DIR/rr-cache"
+           then
+               git-rerere
+           fi
            echo Failed to merge in the changes.
            exit 1
     }