Only call git-rerere if $GIT_DIR/rr-cache exists.
authorJunio C Hamano <junkio@cox.net>
Sun, 12 Feb 2006 02:55:43 +0000 (18:55 -0800)
committerJunio C Hamano <junkio@cox.net>
Sun, 12 Feb 2006 02:55:43 +0000 (18:55 -0800)
Johannes noticed that git-rerere depends on Digest.pm, and if
one does not use the command, one can live without it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
git-am.sh
git-commit.sh
git-merge.sh

index ee6886f..98b9215 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
@@ -88,7 +88,10 @@ fall_back_3way () {
     # saying that we reverted all those changes.
 
     git-merge-resolve $orig_tree -- HEAD $his_tree || {
-           git-rerere
+           if test -d "$GIT_DIR/rr-cache"
+           then
+               git-rerere
+           fi
            echo Failed to merge in the changes.
            exit 1
     }
index 073ec81..59551d9 100755 (executable)
@@ -638,7 +638,10 @@ else
 fi
 ret="$?"
 rm -f "$GIT_DIR/COMMIT_MSG" "$GIT_DIR/COMMIT_EDITMSG"
-git-rerere
+if test -d "$GIT_DIR/rr-cache"
+then
+       git-rerere
+fi
 
 if test -x "$GIT_DIR"/hooks/post-commit && test "$ret" = 0
 then
index dc17baf..74f0761 100755 (executable)
@@ -309,6 +309,9 @@ Conflicts:
                sed -e 's/^[^   ]*      /       /' |
                uniq
        } >>"$GIT_DIR/MERGE_MSG"
-       git rerere
+       if test -d "$GIT_DIR/rr-cache"
+       then
+               git-rerere
+       fi
        die "Automatic merge failed; fix up by hand"
 fi