Skip to content

Commit

Permalink
Merge branch 'sg/complete-symmetric-diff'
Browse files Browse the repository at this point in the history
* sg/complete-symmetric-diff:
  bash: complete 'git diff ...branc<TAB>'
  bash: fix misindented esac statement in __git_complete_file()
  • Loading branch information
Junio C Hamano committed Mar 23, 2011
2 parents 785d698 + 1d66ec5 commit 1c92e39
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions contrib/completion/git-completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -664,11 +664,14 @@ __git_compute_merge_strategies ()
: ${__git_merge_strategies:=$(__git_list_merge_strategies)}
}

__git_complete_file ()
__git_complete_revlist_file ()
{
local pfx ls ref cur
_get_comp_words_by_ref -n =: cur
case "$cur" in
*..?*:*)
return
;;
?*:*)
ref="${cur%%:*}"
cur="${cur#*:}"
Expand All @@ -682,7 +685,7 @@ __git_complete_file ()
*)
ls="$ref"
;;
esac
esac

case "$COMP_WORDBREAKS" in
*:*) : great ;;
Expand All @@ -707,17 +710,6 @@ __git_complete_file ()
s/^.* //')" \
-- "$cur"))
;;
*)
__gitcomp "$(__git_refs)"
;;
esac
}

__git_complete_revlist ()
{
local pfx cur
_get_comp_words_by_ref -n =: cur
case "$cur" in
*...*)
pfx="${cur%...*}..."
cur="${cur#*...}"
Expand All @@ -734,6 +726,17 @@ __git_complete_revlist ()
esac
}


__git_complete_file ()
{
__git_complete_revlist_file
}

__git_complete_revlist ()
{
__git_complete_revlist_file
}

__git_complete_remote_or_refspec ()
{
local cur words cword
Expand Down Expand Up @@ -1356,7 +1359,7 @@ _git_diff ()
return
;;
esac
__git_complete_file
__git_complete_revlist_file
}

__git_mergetools_common="diffuse ecmerge emerge kdiff3 meld opendiff
Expand Down

0 comments on commit 1c92e39

Please sign in to comment.