aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-03-22 21:37:47 -0700
committerJunio C Hamano <gitster@pobox.com>2011-03-22 21:37:47 -0700
commit1c92e394468c927f129c8f2a138b760f884e3bed (patch)
tree23a2dd65fd4e8c2ace03e9490411133f482f85c8 /contrib
parent785d6989dac6a61eabdc06c781ee0f47d10f36c0 (diff)
parent1d66ec587e7d903afdf12a81718772a9eadc15a1 (diff)
downloadgit-1c92e394468c927f129c8f2a138b760f884e3bed.tar.gz
git-1c92e394468c927f129c8f2a138b760f884e3bed.tar.xz
Merge branch 'sg/complete-symmetric-diff'
* sg/complete-symmetric-diff: bash: complete 'git diff ...branc<TAB>' bash: fix misindented esac statement in __git_complete_file()
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/completion/git-completion.bash31
1 files changed, 17 insertions, 14 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index ccdc172a0..3b1cc83e2 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -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#*:}"
@@ -682,7 +685,7 @@ __git_complete_file ()
*)
ls="$ref"
;;
- esac
+ esac
case "$COMP_WORDBREAKS" in
*:*) : great ;;
@@ -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#*...}"
@@ -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
@@ -1356,7 +1359,7 @@ _git_diff ()
return
;;
esac
- __git_complete_file
+ __git_complete_revlist_file
}
__git_mergetools_common="diffuse ecmerge emerge kdiff3 meld opendiff