Skip to content

Commit

Permalink
bash: Support new 'git fetch' options
Browse files Browse the repository at this point in the history
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 <bgustavsson@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Björn Gustavsson authored and Junio C Hamano committed Dec 12, 2009
1 parent 4966688 commit e25e2b4
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions contrib/completion/git-completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,17 @@ __git_complete_remote_or_refspec ()
while [ $c -lt $COMP_CWORD ]; do
i="${COMP_WORDS[c]}"
case "$i" in
--all|--mirror) [ "$cmd" = "push" ] && no_complete_refspec=1 ;;
--mirror) [ "$cmd" = "push" ] && no_complete_refspec=1 ;;
--all)
case "$cmd" in
push) no_complete_refspec=1 ;;
fetch)
COMPREPLY=()
return
;;
*) ;;
esac
;;
-*) ;;
*) remote="$i"; break ;;
esac
Expand Down Expand Up @@ -1002,7 +1012,7 @@ _git_difftool ()

__git_fetch_options="
--quiet --verbose --append --upload-pack --force --keep --depth=
--tags --no-tags
--tags --no-tags --all --prune --dry-run
"

_git_fetch ()
Expand Down

0 comments on commit e25e2b4

Please sign in to comment.