aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-12-06 13:51:57 +1300
committerTom Ryder <tom@sanctum.geek.nz>2018-12-06 13:51:57 +1300
commit25fcf3e988c30ef64d6555e0511371647390277f (patch)
tree3e1b1459af71397244179857d83a055eb70918fd
parentApply much simpler completion to Git (diff)
downloaddotfiles-25fcf3e988c30ef64d6555e0511371647390277f.tar.gz
dotfiles-25fcf3e988c30ef64d6555e0511371647390277f.zip
Add actual completion matching to git completion
Doi.
-rw-r--r--bash/bash_completion.d/git.bash10
1 files changed, 8 insertions, 2 deletions
diff --git a/bash/bash_completion.d/git.bash b/bash/bash_completion.d/git.bash
index 450160fc..ea5e00cd 100644
--- a/bash/bash_completion.d/git.bash
+++ b/bash/bash_completion.d/git.bash
@@ -15,7 +15,10 @@ _git() {
98)
local ci
while read -r _ ref ; do
- COMPREPLY[ci++]=${ref#refs/heads/}
+ branch=${ref#refs/heads/}
+ case $branch in
+ "$2"*) COMPREPLY[ci++]=$branch ;;
+ esac
done < <(git show-ref --heads)
;;
@@ -23,7 +26,10 @@ _git() {
116)
local ci
while read -r _ ref ; do
- COMPREPLY[ci++]=${ref#refs/tags/}
+ tag=${ref#refs/tags/}
+ case $tag in
+ "$2"*) COMPREPLY[ci++]=$tag ;;
+ esac
done < <(git show-ref --tags)
;;