remote: check for superfluous arguments in 'git remote add'

The 'git remote add' subcommand did not check for superfluous command line arguments. Make it so. Signed-off-by: Thomas Rast <trast@inf.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Thomas Rast committed Apr 24, 2013 at 15:54 UTC 2d2e3d25595c1bcd2259db5eb7604f196d35949f
2 files changed +2 -2
builtin/remote.c
+1 -1
@@ -178,7 +178,7 @@ static int add(int argc, const char **argv)
178 argc = parse_options(argc, argv, NULL, options, builtin_remote_add_usage,
179 0);
180
181 - if (argc < 2)
181 + if (argc != 2)
182 usage_with_options(builtin_remote_add_usage, options);
183
184 if (mirror && master)
t/t5505-remote.sh
+1 -1
@@ -1020,7 +1020,7 @@ test_extra_arg () {
1020 "
1021 }
1022
1023 -test_extra_arg -f add nick url
1023 +test_extra_arg add nick url
1024 test_extra_arg rename origin newname
1025 test_extra_arg remove origin
1026 test_extra_arg set-head origin master