test: fix for COLUMNS and bash 5
[git/debian.git] / t / t1021-rerere-in-workdir.sh
blob0b892894eb9031d88aa26cf43fc09235a2aa07bc
1 #!/bin/sh
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-lib.sh
9 test_expect_success SYMLINKS setup '
10 git config rerere.enabled true &&
11 >world &&
12 git add world &&
13 test_tick &&
14 git commit -m initial &&
16 echo hello >world &&
17 test_tick &&
18 git commit -a -m hello &&
20 git checkout -b side HEAD^ &&
21 echo goodbye >world &&
22 test_tick &&
23 git commit -a -m goodbye &&
25 git checkout main
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 &&
32 cd work &&
33 test_must_fail git merge side &&
34 git rerere status >actual &&
35 echo world >expect &&
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 &&
48 cd 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 &&
53 echo world >expect &&
54 test_cmp expect actual
58 test_done