From 1536dd9c61b5582cf079999057cb715dd6dc6620 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 11 Feb 2006 18:55:43 -0800 Subject: [PATCH] Only call git-rerere if $GIT_DIR/rr-cache exists. 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 --- git-am.sh | 5 ++++- git-commit.sh | 5 ++++- git-merge.sh | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/git-am.sh b/git-am.sh index ee6886f30..98b9215f7 100755 --- 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 } diff --git a/git-commit.sh b/git-commit.sh index 073ec81e1..59551d99f 100755 --- a/git-commit.sh +++ b/git-commit.sh @@ -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 diff --git a/git-merge.sh b/git-merge.sh index dc17baf6e..74f07610f 100755 --- a/git-merge.sh +++ b/git-merge.sh @@ -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 -- 2.30.2