summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3b376b0)
raw | patch | inline | side by side (parent: 3b376b0)
author | SZEDER Gábor <szeder@ira.uka.de> | |
Tue, 4 Mar 2008 18:00:59 +0000 (19:00 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 5 Mar 2008 20:10:29 +0000 (12:10 -0800) |
But still all branches are listed, if -r is present
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-completion.bash | patch | blob | history |
index 8d6733abe4063cebbb0ac2d6e020077ed78fe438..49e6df09654f061d674f18ffcd6347f82ea644fa 100755 (executable)
_git_branch ()
{
+ local i c=1 only_local_ref="n" has_r="n"
+
+ while [ $c -lt $COMP_CWORD ]; do
+ i="${COMP_WORDS[c]}"
+ case "$i" in
+ -d|-m) only_local_ref="y" ;;
+ -r) has_r="y" ;;
+ esac
+ c=$((++c))
+ done
+
case "${COMP_WORDS[COMP_CWORD]}" in
--*=*) COMPREPLY=() ;;
--*)
--track --no-track
"
;;
- *) __gitcomp "$(__git_refs)" ;;
+ *)
+ if [ $only_local_ref = "y" -a $has_r = "n" ]; then
+ __gitcomp "$(__git_heads)"
+ else
+ __gitcomp "$(__git_refs)"
+ fi
+ ;;
esac
}