@matheusbsbs / matheus-bagliano / commits / 4a62eaed31
Fork 0

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 <junkio@cox.net>

Junio C Hamano committed Dec 5, 2005 at 22:29 UTC 4a62eaed317e260b0bdb0ce5f340757d2a6dfef1
1 file changed +1 -3
init-db.c
+1 -3
@@ -237,9 +237,7 @@ int main(int argc, char **argv)
237
238 for (i = 1; i < argc; i++, argv++) {
239 char *arg = argv[1];
240 - if (arg[0] != '-')
241 - break;
242 - else if (!strncmp(arg, "--template=", 11))
240 + if (!strncmp(arg, "--template=", 11))
241 template_dir = arg+11;
242 else
243 die(init_db_usage);