3 test_description
='rerere run in a workdir'
4 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
=main
5 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
7 TEST_PASSES_SANITIZE_LEAK
=true
10 test_expect_success SYMLINKS setup
'
11 git config rerere.enabled true &&
15 git commit -m initial &&
19 git commit -a -m hello &&
21 git checkout -b side HEAD^ &&
22 echo goodbye >world &&
24 git commit -a -m goodbye &&
29 test_expect_success SYMLINKS
'rerere in workdir' '
30 rm -rf .git/rr-cache &&
31 "$SHELL_PATH" "$TEST_DIRECTORY/../contrib/workdir/git-new-workdir" . work &&
34 test_must_fail git merge side &&
35 git rerere status >actual &&
37 test_cmp expect actual
41 # This fails because we don't resolve relative symlink in mkdir_in_gitdir()
42 # For the purpose of helping contrib/workdir/git-new-workdir users, we do not
43 # have to support relative symlinks, but it might be nicer to make this work
44 # with a relative symbolic link someday.
45 test_expect_failure SYMLINKS
'rerere in workdir (relative)' '
46 rm -rf .git/rr-cache &&
47 "$SHELL_PATH" "$TEST_DIRECTORY/../contrib/workdir/git-new-workdir" . krow &&
50 rm -f .git/rr-cache &&
51 ln -s ../.git/rr-cache .git/rr-cache &&
52 test_must_fail git merge side &&
53 git rerere status >actual &&
55 test_cmp expect actual