aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorDerrick Stolee <stolee@gmail.com>2026-03-26 15:14:54 +0000
committerJunio C Hamano <gitster@pobox.com>2026-03-26 09:38:07 -0700
commit46d1f4cf4dcb8aaf799f78410af829e149086f36 (patch)
tree9b8cf5d9f86d14c841e374778523167a98328cd0 /builtin
parent3f20c21a1ceeb796e121147a53ba10d28041b1fe (diff)
downloadgit-46d1f4cf4dcb8aaf799f78410af829e149086f36.tar.xz
t5620: test backfill's unknown argument handling
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. [1] https://lore.kernel.org/git/20260321031643.5185-1-r.siddharth.shrimali@gmail.com/ Note that the revision machinery can output an "ambiguous argument" warning if a value not starting with '--' is found and doesn't make sense as a reference or a pathspec. For unrecognized arguments starting with '--' we need to add logic into builtin/backfill.c to catch leftover arguments. Reported-by: Siddharth Shrimali <r.siddharth.shrimali@gmail.com> Signed-off-by: Derrick Stolee <stolee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/backfill.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/builtin/backfill.c b/builtin/backfill.c
index b98b0b591f..2c5ce56fb7 100644
--- a/builtin/backfill.c
+++ b/builtin/backfill.c
@@ -142,6 +142,9 @@ int cmd_backfill(int argc, const char **argv, const char *prefix, struct reposit
repo_init_revisions(repo, &ctx.revs, prefix);
argc = setup_revisions(argc, argv, &ctx.revs, NULL);
+ if (argc > 1)
+ die(_("unrecognized argument: %s"), argv[1]);
+
repo_config(repo, git_default_config, NULL);
if (ctx.sparse < 0)