Skip to content

Commit b17dd3f

Browse files
Thomas Rastgitster
authored andcommitted
remote: 'show' and 'prune' can take more than one remote
The 'git remote show' and 'prune' subcommands are documented as taking only a single remote name argument, but that is not the case; they will simply iterate the action over all remotes given. Update the documentation and tests to match. With the last user of the -f flag gone, we also remove the code supporting it. Signed-off-by: Thomas Rast <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2d2e3d2 commit b17dd3f

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

Documentation/git-remote.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ SYNOPSIS
1818
'git remote set-url' [--push] <name> <newurl> [<oldurl>]
1919
'git remote set-url --add' [--push] <name> <newurl>
2020
'git remote set-url --delete' [--push] <name> <url>
21-
'git remote' [-v | --verbose] 'show' [-n] <name>
22-
'git remote prune' [-n | --dry-run] <name>
21+
'git remote' [-v | --verbose] 'show' [-n] <name>...
22+
'git remote prune' [-n | --dry-run] <name>...
2323
'git remote' [-v | --verbose] 'update' [-p | --prune] [(<group> | <remote>)...]
2424

2525
DESCRIPTION

t/t5505-remote.sh

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,12 +1009,7 @@ test_expect_success 'extra args: setup' '
10091009
'
10101010

10111011
test_extra_arg () {
1012-
expect="success"
1013-
if test "z$1" = "z-f"; then
1014-
expect=failure
1015-
shift
1016-
fi
1017-
test_expect_$expect "extra args: $*" "
1012+
test_expect_success "extra args: $*" "
10181013
test_must_fail git remote $* bogus_extra_arg 2>actual &&
10191014
grep '^usage:' actual
10201015
"
@@ -1026,8 +1021,8 @@ test_extra_arg remove origin
10261021
test_extra_arg set-head origin master
10271022
# set-branches takes any number of args
10281023
test_extra_arg set-url origin newurl oldurl
1029-
test_extra_arg -f show origin
1030-
test_extra_arg -f prune origin
1024+
# show takes any number of args
1025+
# prune takes any number of args
10311026
# update takes any number of args
10321027

10331028
test_done

0 commit comments

Comments
 (0)