Skip to content

Commit 2f566d6

Browse files
hanwengitster
authored andcommitted
t3320: use git-symbolic-ref rather than filesystem access
Signed-off-by: Han-Wen Nienhuys <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e46775c commit 2f566d6

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

t/t3320-notes-merge-worktrees.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ test_expect_success 'create some new worktrees' '
4646
test_expect_success 'merge z into y fails and sets NOTES_MERGE_REF' '
4747
git config core.notesRef refs/notes/y &&
4848
test_must_fail git notes merge z &&
49-
echo "ref: refs/notes/y" >expect &&
50-
test_cmp expect .git/NOTES_MERGE_REF
49+
echo "refs/notes/y" >expect &&
50+
git symbolic-ref NOTES_MERGE_REF >actual &&
51+
test_cmp expect actual
5152
'
5253

5354
test_expect_success 'merge z into y while mid-merge in another workdir fails' '
@@ -57,7 +58,7 @@ test_expect_success 'merge z into y while mid-merge in another workdir fails' '
5758
test_must_fail git notes merge z 2>err &&
5859
test_i18ngrep "a notes merge into refs/notes/y is already in-progress at" err
5960
) &&
60-
test_path_is_missing .git/worktrees/worktree/NOTES_MERGE_REF
61+
test_must_fail git -C worktree symbolic-ref NOTES_MERGE_REF
6162
'
6263

6364
test_expect_success 'merge z into x while mid-merge on y succeeds' '
@@ -68,8 +69,9 @@ test_expect_success 'merge z into x while mid-merge on y succeeds' '
6869
test_i18ngrep "Automatic notes merge failed" out &&
6970
grep -v "A notes merge into refs/notes/x is already in-progress in" out
7071
) &&
71-
echo "ref: refs/notes/x" >expect &&
72-
test_cmp expect .git/worktrees/worktree2/NOTES_MERGE_REF
72+
echo "refs/notes/x" >expect &&
73+
git -C worktree2 symbolic-ref NOTES_MERGE_REF >actual &&
74+
test_cmp expect actual
7375
'
7476

7577
test_done

0 commit comments

Comments
 (0)