[PATCH v2 6/6] t5620: test backfill's unknown argument handling
- From
Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Mar 23, 2026, 11:40 UTC
- Message-ID
- <9699650aa7dc04cf1cdc26803caa8304b29c1662.1774266019.git.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.2070.v2.git.1774266019.gitgitgadget@gmail.com>
From: Derrick Stolee <stolee@gmail.com>
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/20260321031643.5185-1-r.siddharth.shrimali@gmail.com/
Reported-by: Siddharth Shrimali <r.siddharth.shrimali@gmail.com> Signed-off-by: Derrick Stolee <stolee@gmail.com> --- 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