t7509: avoid direct file access for writing CHERRY_PICK_HEAD
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Han-Wen Nienhuys committed
Jul 6, 2021 at 18:47 UTC
52a47aea70875cb64a5a975189d6b5ba35b81574
1 file changed
+2
-2
t/t7509-commit-authorship.sh
+2
-2
@@ -147,7 +147,7 @@ test_expect_success 'commit respects CHERRY_PICK_HEAD and MERGE_MSG' '
147
test_tick &&
148
git commit -am "cherry-pick 1" --author="Cherry <cherry@pick.er>" &&
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
echo "This is a MERGE_MSG" >.git/MERGE_MSG &&
152
echo "cherry-pick 1b" >>foo &&
153
test_tick &&
@@ -162,7 +162,7 @@ test_expect_success 'commit respects CHERRY_PICK_HEAD and MERGE_MSG' '
162
'
163
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
echo "cherry-pick 2" >>foo &&
167
test_tick &&
168
git commit -am "cherry-pick 2" --reset-author &&