Skip to content

Commit

Permalink
remote: check for superfluous arguments in 'git remote add'
Browse files Browse the repository at this point in the history
The 'git remote add' subcommand did not check for superfluous command
line arguments.  Make it so.

Signed-off-by: Thomas Rast <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
Thomas Rast authored and gitster committed Apr 24, 2013
1 parent abf5f87 commit 2d2e3d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion builtin/remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion t/t5505-remote.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2d2e3d2

Please sign in to comment.