aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-03-26 20:13:16 -0700
committerJunio C Hamano <gitster@pobox.com>2011-03-26 20:13:16 -0700
commitad7bb2f68c0b7786521173e05ef58d0f3e0db3d7 (patch)
tree9fc6b2df2743b837f774c0ce925cdad2427c4535 /t
parent54f6a8dbd65cbe6ad31a8b6b531de81009514eb3 (diff)
parent90a6464b4ad5887e4d12e660f51dabdbd5c00812 (diff)
downloadgit-ad7bb2f68c0b7786521173e05ef58d0f3e0db3d7.tar.gz
git-ad7bb2f68c0b7786521173e05ef58d0f3e0db3d7.tar.xz
Merge branch 'jc/maint-rerere-in-workdir'
* jc/maint-rerere-in-workdir: rerere: make sure it works even in a workdir attached to a young repository
Diffstat (limited to 't')
-rwxr-xr-xt/t1021-rerere-in-workdir.sh55
1 files changed, 55 insertions, 0 deletions
diff --git a/t/t1021-rerere-in-workdir.sh b/t/t1021-rerere-in-workdir.sh
new file mode 100755
index 000000000..301e071ff
--- /dev/null
+++ b/t/t1021-rerere-in-workdir.sh
@@ -0,0 +1,55 @@
+#!/bin/sh
+
+test_description='rerere run in a workdir'
+. ./test-lib.sh
+
+test_expect_success SYMLINKS setup '
+ git config rerere.enabled true &&
+ >world &&
+ git add world &&
+ test_tick &&
+ git commit -m initial &&
+
+ echo hello >world &&
+ test_tick &&
+ git commit -a -m hello &&
+
+ git checkout -b side HEAD^ &&
+ echo goodbye >world &&
+ test_tick &&
+ git commit -a -m goodbye &&
+
+ git checkout master
+'
+
+test_expect_success SYMLINKS 'rerere in workdir' '
+ rm -rf .git/rr-cache &&
+ "$SHELL_PATH" "$TEST_DIRECTORY/../contrib/workdir/git-new-workdir" . work &&
+ (
+ cd work &&
+ test_must_fail git merge side &&
+ git rerere status >actual &&
+ echo world >expect &&
+ test_cmp expect actual
+ )
+'
+
+# This fails because we don't resolve relative symlink in mkdir_in_gitdir()
+# For the purpose of helping contrib/workdir/git-new-workdir users, we do not
+# have to support relative symlinks, but it might be nicer to make this work
+# with a relative symbolic link someday.
+test_expect_failure SYMLINKS 'rerere in workdir (relative)' '
+ rm -rf .git/rr-cache &&
+ "$SHELL_PATH" "$TEST_DIRECTORY/../contrib/workdir/git-new-workdir" . krow &&
+ (
+ cd krow &&
+ rm -f .git/rr-cache &&
+ ln -s ../.git/rr-cache .git/rr-cache &&
+ test_must_fail git merge side &&
+ git rerere status >actual &&
+ echo world >expect &&
+ test_cmp expect actual
+ )
+'
+
+test_done