]> git.ipfire.org Git - thirdparty/git.git/blame - t/t1021-rerere-in-workdir.sh
The third batch
[thirdparty/git.git] / t / t1021-rerere-in-workdir.sh
CommitLineData
90a6464b
JH
1#!/bin/sh
2
3test_description='rerere run in a workdir'
06d53148 4GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
334afbc7
JS
5export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
6
90a6464b
JH
7. ./test-lib.sh
8
9test_expect_success SYMLINKS setup '
10 git config rerere.enabled true &&
11 >world &&
12 git add world &&
13 test_tick &&
14 git commit -m initial &&
15
16 echo hello >world &&
17 test_tick &&
18 git commit -a -m hello &&
19
20 git checkout -b side HEAD^ &&
21 echo goodbye >world &&
22 test_tick &&
23 git commit -a -m goodbye &&
24
06d53148 25 git checkout main
90a6464b
JH
26'
27
28test_expect_success SYMLINKS 'rerere in workdir' '
29 rm -rf .git/rr-cache &&
30 "$SHELL_PATH" "$TEST_DIRECTORY/../contrib/workdir/git-new-workdir" . work &&
31 (
32 cd work &&
33 test_must_fail git merge side &&
34 git rerere status >actual &&
35 echo world >expect &&
36 test_cmp expect actual
37 )
38'
39
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.
44test_expect_failure SYMLINKS 'rerere in workdir (relative)' '
45 rm -rf .git/rr-cache &&
46 "$SHELL_PATH" "$TEST_DIRECTORY/../contrib/workdir/git-new-workdir" . krow &&
47 (
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
55 )
56'
57
58test_done