git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/2] t7509: avoid direct file access for writing CHERRY_PICK_HEAD

From
Han-Wen Nienhuys via GitGitGadget <gitgitgadget@gmail.com>
Date
Jul 6, 2021, 18:47 UTC
Message-ID
<011bbd2ecc8ded798ce47c2c6a2bde64d3f98d2d.1625597277.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.1042.git.git.1625597277.gitgitgadget@gmail.com>
From: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t7509-commit-authorship.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t7509-commit-authorship.sh b/t/t7509-commit-authorship.sh
index ee6c47416ed..d568593382c 100755
--- a/t/t7509-commit-authorship.sh
+++ b/t/t7509-commit-authorship.sh
@@ -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 &&
-- 
gitgitgadget
Previous: Han-Wen Nienhuys via GitGitGadgetNext: Junio C Hamano
Message 3 of 4 in “fix 2 more test files that were accessing file system directly.”
  1. 0/2 fix 2 more test files that were accessing file system directly.Han-Wen Nienhuys via GitGitGadget, Jul 6, 2021
  2. 1/2 t1415: avoid direct filesystem access for writing refsHan-Wen Nienhuys via GitGitGadget, Jul 6, 2021
  3. 2/2 t7509: avoid direct file access for writing CHERRY_PICK_HEADHan-Wen Nienhuys via GitGitGadget, Jul 6, 2021
  4. Junio C HamanoJul 6, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.