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