Subject: [PATCH v2 6/6] t5620: test backfill's unknown argument handling

From: "Derrick Stolee via GitGitGadget" <[email-masked]>
Date: Mon, 23 Mar 2026 11:40:19 +0000

From: Derrick Stolee <[email-masked]>

Before the recent changes to parse rev-list arguments inside of 'git
backfill', the builtin would take arbitrary arguments without complaint (and
ignore them). This was noticed and a patch was sent [1] which motivates this
change to encode this behavior in test.

[1] https://lore.kernel.org/git/[email-masked]/

Reported-by: Siddharth Shrimali <[email-masked]>
Signed-off-by: Derrick Stolee <[email-masked]>
---
 t/t5620-backfill.sh | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/t/t5620-backfill.sh b/t/t5620-backfill.sh
index c6f54ee91c..85740f1f13 100755
--- a/t/t5620-backfill.sh
+++ b/t/t5620-backfill.sh
@@ -7,6 +7,14 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
 
+test_expect_success 'backfill rejects unexpected arguments' '
+	test_must_fail git backfill unexpected-arg 2>err &&
+	test_grep "ambiguous argument .*unexpected-arg" err &&
+
+	test_must_fail git backfill --all --firt-parent unexpected-arg 2>err &&
+	test_grep "ambiguous argument .*unexpected-arg" err
+'
+
 # We create objects in the 'src' repo.
 test_expect_success 'setup repo for object creation' '
 	echo "{print \$1}" >print_1.awk &&
-- 
gitgitgadget