File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -37,9 +37,8 @@ test_expect_success 'resolve main-worktree/HEAD' '
37
37
'
38
38
39
39
test_expect_success ' ambiguous main-worktree/HEAD' '
40
- mkdir -p .git/refs/heads/main-worktree &&
41
- test_when_finished rm -f .git/refs/heads/main-worktree/HEAD &&
42
- cp .git/HEAD .git/refs/heads/main-worktree/HEAD &&
40
+ test_when_finished git update-ref -d refs/heads/main-worktree/HEAD &&
41
+ git update-ref refs/heads/main-worktree/HEAD $(git rev-parse HEAD) &&
43
42
git rev-parse main-worktree/HEAD 2>warn &&
44
43
grep "main-worktree/HEAD.*ambiguous" warn
45
44
'
@@ -51,9 +50,8 @@ test_expect_success 'resolve worktrees/xx/HEAD' '
51
50
'
52
51
53
52
test_expect_success ' ambiguous worktrees/xx/HEAD' '
54
- mkdir -p .git/refs/heads/worktrees/wt1 &&
55
- test_when_finished rm -f .git/refs/heads/worktrees/wt1/HEAD &&
56
- cp .git/HEAD .git/refs/heads/worktrees/wt1/HEAD &&
53
+ git update-ref refs/heads/worktrees/wt1/HEAD $(git rev-parse HEAD) &&
54
+ test_when_finished git update-ref -d refs/heads/worktrees/wt1/HEAD &&
57
55
git rev-parse worktrees/wt1/HEAD 2>warn &&
58
56
grep "worktrees/wt1/HEAD.*ambiguous" warn
59
57
'
You can’t perform that action at this time.
0 commit comments