]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t7509: avoid direct file access for writing CHERRY_PICK_HEAD
authorHan-Wen Nienhuys <hanwen@google.com>
Tue, 6 Jul 2021 18:47:57 +0000 (18:47 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 6 Jul 2021 19:56:38 +0000 (12:56 -0700)
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7509-commit-authorship.sh

index ee6c47416ed92ee259c908835285e8774d75a39b..d568593382cfb062b629f07fb6dcf1a23baeb8b9 100755 (executable)
@@ -147,7 +147,7 @@ test_expect_success 'commit respects CHERRY_PICK_HEAD and MERGE_MSG' '
        test_tick &&
        git commit -am "cherry-pick 1" --author="Cherry <cherry@pick.er>" &&
        git tag cherry-pick-head &&
-       git rev-parse cherry-pick-head >.git/CHERRY_PICK_HEAD &&
+       git update-ref CHERRY_PICK_HEAD $(git rev-parse cherry-pick-head) &&
        echo "This is a MERGE_MSG" >.git/MERGE_MSG &&
        echo "cherry-pick 1b" >>foo &&
        test_tick &&
@@ -162,7 +162,7 @@ test_expect_success 'commit respects CHERRY_PICK_HEAD and MERGE_MSG' '
 '
 
 test_expect_success '--reset-author with CHERRY_PICK_HEAD' '
-       git rev-parse cherry-pick-head >.git/CHERRY_PICK_HEAD &&
+       git update-ref CHERRY_PICK_HEAD $(git rev-parse cherry-pick-head) &&
        echo "cherry-pick 2" >>foo &&
        test_tick &&
        git commit -am "cherry-pick 2" --reset-author &&