Git development
 help / color / mirror / Atom feed
* [PATCH 1/2] t3507: pin CHERRY_PICK_HEAD absence for a conflicting --no-commit
@ 2026-09-03 12:55 Aleksei Sviridkin
  2026-09-03 12:55 ` [PATCH 2/2] doc: cherry-pick: note --no-commit skips CHERRY_PICK_HEAD Aleksei Sviridkin
                   ` (4 more replies)
  0 siblings, 5 replies; 21+ messages in thread
From: Aleksei Sviridkin @ 2026-09-03 12:55 UTC (permalink / raw)
  To: git; +Cc: Aleksei Sviridkin

The tests here check the ref after a conflicting pick, after a clean
pick and after a clean pick under --no-commit, but not after a
conflicting one under --no-commit.  That is the combination a user
runs into by accident: the pick stops with conflicts, and the ref
"git commit" would take the authorship from is not there.

Pin it next to its siblings.  Letting the ref be written under
--no-commit when the pick conflicts leaves the rest of the cherry-pick
tests green, so nothing else guards that path.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
---
 t/t3507-cherry-pick-conflict.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/t/t3507-cherry-pick-conflict.sh b/t/t3507-cherry-pick-conflict.sh
index 44596cb1e8..2ce2e88184 100755
--- a/t/t3507-cherry-pick-conflict.sh
+++ b/t/t3507-cherry-pick-conflict.sh
@@ -100,6 +100,12 @@ test_expect_success 'cherry-pick --no-commit does not set CHERRY_PICK_HEAD' '
 	test_must_fail git rev-parse --verify CHERRY_PICK_HEAD
 '
 
+test_expect_success 'failed cherry-pick --no-commit does not set CHERRY_PICK_HEAD' '
+	pristine_detach initial &&
+	test_must_fail git cherry-pick --no-commit picked &&
+	test_must_fail git rev-parse --verify CHERRY_PICK_HEAD
+'
+
 test_expect_success 'cherry-pick w/dirty tree does not set CHERRY_PICK_HEAD' '
 	pristine_detach initial &&
 	echo foo >foo &&

base-commit: e9019fcafe0040228b8631c30f97ae1adb61bcdc
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2026-09-05 17:13 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-03 12:55 [PATCH 1/2] t3507: pin CHERRY_PICK_HEAD absence for a conflicting --no-commit Aleksei Sviridkin
2026-09-03 12:55 ` [PATCH 2/2] doc: cherry-pick: note --no-commit skips CHERRY_PICK_HEAD Aleksei Sviridkin
2026-09-03 21:32 ` [PATCH 1/2] t3507: pin CHERRY_PICK_HEAD absence for a conflicting --no-commit Junio C Hamano
2026-09-03 21:45   ` Aleksei Sviridkin
2026-09-04  9:41     ` Patrick Steinhardt
2026-09-04 12:45       ` Aleksei Sviridkin
2026-09-04 13:53       ` Phillip Wood
2026-09-05 17:13         ` Aleksei Sviridkin
2026-09-04 16:17       ` Junio C Hamano
2026-09-05 17:13       ` Aleksei Sviridkin
2026-09-04  9:53   ` Phillip Wood
2026-09-04 16:20     ` Junio C Hamano
2026-09-04  9:57 ` Phillip Wood
2026-09-04 12:45   ` Aleksei Sviridkin
2026-09-04 13:57     ` Phillip Wood
2026-09-05 17:13       ` Aleksei Sviridkin
2026-09-04 12:44 ` [PATCH v2] doc: cherry-pick: note --no-commit skips CHERRY_PICK_HEAD Aleksei Sviridkin
2026-09-05 16:29   ` Junio C Hamano
2026-09-05 17:13 ` [PATCH v3 0/2] cherry-pick: document that " Aleksei Sviridkin
2026-09-05 17:13   ` [PATCH v3 1/2] t3507: check no CHERRY_PICK_HEAD after conflicting --no-commit Aleksei Sviridkin
2026-09-05 17:13   ` [PATCH v3 2/2] doc: cherry-pick: note --no-commit skips CHERRY_PICK_HEAD Aleksei Sviridkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox