From: Junio C Hamano Date: Tue, 6 Dec 2005 06:29:36 +0000 (-0800) Subject: init-db: check extra arguments and complain. X-Git-Tag: v0.99.9m^2~59 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4a62eaed317e260b0bdb0ce5f340757d2a6dfef1;p=git.git init-db: check extra arguments and complain. "git-init-db junk" does not complain but just ignores "junk". Die with the usage string in such a case. Signed-off-by: Junio C Hamano --- diff --git a/init-db.c b/init-db.c index 8195b6842..ead37b5ed 100644 --- a/init-db.c +++ b/init-db.c @@ -237,9 +237,7 @@ int main(int argc, char **argv) for (i = 1; i < argc; i++, argv++) { char *arg = argv[1]; - if (arg[0] != '-') - break; - else if (!strncmp(arg, "--template=", 11)) + if (!strncmp(arg, "--template=", 11)) template_dir = arg+11; else die(init_db_usage);