File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -40,9 +40,8 @@ test_expect_success 'resolve main-worktree/HEAD' '
40
40
'
41
41
42
42
test_expect_success ' ambiguous main-worktree/HEAD' '
43
- mkdir -p .git/refs/heads/main-worktree &&
44
- test_when_finished rm -f .git/refs/heads/main-worktree/HEAD &&
45
- cp .git/HEAD .git/refs/heads/main-worktree/HEAD &&
43
+ test_when_finished git update-ref -d refs/heads/main-worktree/HEAD &&
44
+ git update-ref refs/heads/main-worktree/HEAD $(git rev-parse HEAD) &&
46
45
git rev-parse main-worktree/HEAD 2>warn &&
47
46
grep "main-worktree/HEAD.*ambiguous" warn
48
47
'
@@ -54,9 +53,8 @@ test_expect_success 'resolve worktrees/xx/HEAD' '
54
53
'
55
54
56
55
test_expect_success ' ambiguous worktrees/xx/HEAD' '
57
- mkdir -p .git/refs/heads/worktrees/wt1 &&
58
- test_when_finished rm -f .git/refs/heads/worktrees/wt1/HEAD &&
59
- cp .git/HEAD .git/refs/heads/worktrees/wt1/HEAD &&
56
+ git update-ref refs/heads/worktrees/wt1/HEAD $(git rev-parse HEAD) &&
57
+ test_when_finished git update-ref -d refs/heads/worktrees/wt1/HEAD &&
60
58
git rev-parse worktrees/wt1/HEAD 2>warn &&
61
59
grep "worktrees/wt1/HEAD.*ambiguous" warn
62
60
'
Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ test_expect_success 'commit respects CHERRY_PICK_HEAD and MERGE_MSG' '
147
147
test_tick &&
148
148
git commit -am "cherry-pick 1" --author="Cherry <[email protected] >" &&
149
149
git tag cherry-pick-head &&
150
- git rev-parse cherry-pick-head >.git/CHERRY_PICK_HEAD &&
150
+ git update-ref CHERRY_PICK_HEAD $(git rev-parse cherry-pick-head) &&
151
151
echo "This is a MERGE_MSG" >.git/MERGE_MSG &&
152
152
echo "cherry-pick 1b" >>foo &&
153
153
test_tick &&
@@ -162,7 +162,7 @@ test_expect_success 'commit respects CHERRY_PICK_HEAD and MERGE_MSG' '
162
162
'
163
163
164
164
test_expect_success ' --reset-author with CHERRY_PICK_HEAD' '
165
- git rev-parse cherry-pick-head >.git/CHERRY_PICK_HEAD &&
165
+ git update-ref CHERRY_PICK_HEAD $(git rev-parse cherry-pick-head) &&
166
166
echo "cherry-pick 2" >>foo &&
167
167
test_tick &&
168
168
git commit -am "cherry-pick 2" --reset-author &&
You can’t perform that action at this time.
0 commit comments