]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t3320-notes-merge-worktrees.sh
Merge branch 'mk/doc-gitfile-more' into maint-2.43
[thirdparty/git.git] / t / t3320-notes-merge-worktrees.sh
index 052516e6c6ab9d6f78e289d0339f8192379bad98..0fd33280cf91f7fe9384205df8b7570363a37076 100755 (executable)
@@ -8,6 +8,7 @@ test_description='Test merging of notes trees in multiple worktrees'
 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 test_expect_success 'setup commit' '
@@ -46,8 +47,9 @@ test_expect_success 'create some new worktrees' '
 test_expect_success 'merge z into y fails and sets NOTES_MERGE_REF' '
        git config core.notesRef refs/notes/y &&
        test_must_fail git notes merge z &&
-       echo "ref: refs/notes/y" >expect &&
-       test_cmp expect .git/NOTES_MERGE_REF
+       echo "refs/notes/y" >expect &&
+       git symbolic-ref NOTES_MERGE_REF >actual &&
+       test_cmp expect actual
 '
 
 test_expect_success 'merge z into y while mid-merge in another workdir fails' '
@@ -55,9 +57,9 @@ test_expect_success 'merge z into y while mid-merge in another workdir fails' '
                cd worktree &&
                git config core.notesRef refs/notes/y &&
                test_must_fail git notes merge z 2>err &&
-               test_i18ngrep "a notes merge into refs/notes/y is already in-progress at" err
+               test_grep "a notes merge into refs/notes/y is already in-progress at" err
        ) &&
-       test_path_is_missing .git/worktrees/worktree/NOTES_MERGE_REF
+       test_must_fail git -C worktree symbolic-ref NOTES_MERGE_REF
 '
 
 test_expect_success 'merge z into x while mid-merge on y succeeds' '
@@ -65,11 +67,12 @@ test_expect_success 'merge z into x while mid-merge on y succeeds' '
                cd worktree2 &&
                git config core.notesRef refs/notes/x &&
                test_must_fail git notes merge z >out 2>&1 &&
-               test_i18ngrep "Automatic notes merge failed" out &&
+               test_grep "Automatic notes merge failed" out &&
                grep -v "A notes merge into refs/notes/x is already in-progress in" out
        ) &&
-       echo "ref: refs/notes/x" >expect &&
-       test_cmp expect .git/worktrees/worktree2/NOTES_MERGE_REF
+       echo "refs/notes/x" >expect &&
+       git -C worktree2 symbolic-ref NOTES_MERGE_REF >actual &&
+       test_cmp expect actual
 '
 
 test_done