remote: check for superfluous arguments in 'git remote add'
authorThomas Rast <trast@inf.ethz.ch>
Wed, 24 Apr 2013 13:54:36 +0000 (15:54 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 24 Apr 2013 20:12:51 +0000 (13:12 -0700)
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>
builtin/remote.c
t/t5505-remote.sh
index 937484d7c77c448995481f246c1afe2dedd4c561..5e54d367b82cd91dbba70e2570dc620a3a13cd21 100644 (file)
@@ -178,7 +178,7 @@ static int add(int argc, const char **argv)
        argc = parse_options(argc, argv, NULL, options, builtin_remote_add_usage,
                             0);
 
-       if (argc < 2)
+       if (argc != 2)
                usage_with_options(builtin_remote_add_usage, options);
 
        if (mirror && master)
index c23e8482f061e227224f6a99974be0a19821bd8e..07eb378922ac8fbfef715d30ab119f7f18f7950c 100755 (executable)
@@ -1020,7 +1020,7 @@ test_extra_arg () {
        "
 }
 
-test_extra_arg -f add nick url
+test_extra_arg add nick url
 test_extra_arg rename origin newname
 test_extra_arg remove origin
 test_extra_arg set-head origin master