summaryrefslogtreecommitdiff
path: root/t/t4200-rerere.sh
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2007-07-06 12:05:59 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-07-07 05:39:15 (GMT)
commitb4372ef136b0a5a2c1dbd88a11dd72b478d0e0a5 (patch)
tree904accc21f5d15f6d6f49ba2dbe004072764c16a /t/t4200-rerere.sh
parentb2493649fe41f8a0db48ff4e809ea53c8a304a61 (diff)
downloadgit-b4372ef136b0a5a2c1dbd88a11dd72b478d0e0a5.zip
git-b4372ef136b0a5a2c1dbd88a11dd72b478d0e0a5.tar.gz
git-b4372ef136b0a5a2c1dbd88a11dd72b478d0e0a5.tar.bz2
Enable "git rerere" by the config variable rerere.enabled
Earlier, "git rerere" was enabled by creating the directory .git/rr-cache. That is definitely not in line with most other features, which are enabled by a config variable. So, check the config variable "rerere.enabled". If it is set to "false" explicitely, do not activate rerere, even if .git/rr-cache exists. This should help when you want to disable rerere temporarily. If "rerere.enabled" is not set at all, fall back to detection of the directory .git/rr-cache. [jc: with minimum tweaks] Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4200-rerere.sh')
-rwxr-xr-xt/t4200-rerere.sh23
1 files changed, 20 insertions, 3 deletions
diff --git a/t/t4200-rerere.sh b/t/t4200-rerere.sh
index 71d364a..6f55ba0 100755
--- a/t/t4200-rerere.sh
+++ b/t/t4200-rerere.sh
@@ -39,15 +39,32 @@ sed -e 's/To die, t/To die! T/' > a1
echo "* END *" >>a1
git commit -q -a -m second
-# activate rerere
-mkdir .git/rr-cache
+test_expect_success 'nothing recorded without rerere' '
+ (rm -rf .git/rr-cache; git config rerere.enabled false) &&
+ ! git merge first &&
+ ! test -d .git/rr-cache
+'
-test_expect_failure 'conflicting merge' 'git pull . first'
+# activate rerere, old style
+test_expect_success 'conflicting merge' '
+ git reset --hard &&
+ mkdir .git/rr-cache &&
+ git config --unset rerere.enabled &&
+ ! git merge first
+'
sha1=$(sed -e 's/ .*//' .git/rr-cache/MERGE_RR)
rr=.git/rr-cache/$sha1
test_expect_success 'recorded preimage' "grep ======= $rr/preimage"
+test_expect_success 'rerere.enabled works, too' '
+ rm -rf .git/rr-cache &&
+ git config rerere.enabled true &&
+ git reset --hard &&
+ ! git merge first &&
+ grep ======= $rr/preimage
+'
+
test_expect_success 'no postimage or thisimage yet' \
"test ! -f $rr/postimage -a ! -f $rr/thisimage"