Skip to content

Commit e25e2b4

Browse files
bjornggitster
authored andcommitted
bash: Support new 'git fetch' options
Support the new options --all, --prune, and --dry-run for 'git fetch'. As the --multiple option was primarily introduced to enable 'git remote update' to be re-implemented in terms of 'git fetch' (16679e3) and is not likely to be used much from the command line, it does not seems worthwhile to complicate the code (to support completion of multiple remotes) to handle it. Signed-off-by: Björn Gustavsson <[email protected]> Acked-by: Shawn O. Pearce <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4966688 commit e25e2b4

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

contrib/completion/git-completion.bash

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,17 @@ __git_complete_remote_or_refspec ()
417417
while [ $c -lt $COMP_CWORD ]; do
418418
i="${COMP_WORDS[c]}"
419419
case "$i" in
420-
--all|--mirror) [ "$cmd" = "push" ] && no_complete_refspec=1 ;;
420+
--mirror) [ "$cmd" = "push" ] && no_complete_refspec=1 ;;
421+
--all)
422+
case "$cmd" in
423+
push) no_complete_refspec=1 ;;
424+
fetch)
425+
COMPREPLY=()
426+
return
427+
;;
428+
*) ;;
429+
esac
430+
;;
421431
-*) ;;
422432
*) remote="$i"; break ;;
423433
esac
@@ -1002,7 +1012,7 @@ _git_difftool ()
10021012

10031013
__git_fetch_options="
10041014
--quiet --verbose --append --upload-pack --force --keep --depth=
1005-
--tags --no-tags
1015+
--tags --no-tags --all --prune --dry-run
10061016
"
10071017

10081018
_git_fetch ()

0 commit comments

Comments
 (0)