Skip to content

Commit 2d2e3d2

Browse files
Thomas Rastgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent abf5f87 commit 2d2e3d2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

builtin/remote.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ static int add(int argc, const char **argv)
178178
argc = parse_options(argc, argv, NULL, options, builtin_remote_add_usage,
179179
0);
180180

181-
if (argc < 2)
181+
if (argc != 2)
182182
usage_with_options(builtin_remote_add_usage, options);
183183

184184
if (mirror && master)

t/t5505-remote.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1020,7 +1020,7 @@ test_extra_arg () {
10201020
"
10211021
}
10221022

1023-
test_extra_arg -f add nick url
1023+
test_extra_arg add nick url
10241024
test_extra_arg rename origin newname
10251025
test_extra_arg remove origin
10261026
test_extra_arg set-head origin master

0 commit comments

Comments
 (0)