diff options
Diffstat (limited to 'bash/bashrc.d/git.bash')
-rw-r--r-- | bash/bashrc.d/git.bash | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/bash/bashrc.d/git.bash b/bash/bashrc.d/git.bash deleted file mode 100644 index 496712ae..00000000 --- a/bash/bashrc.d/git.bash +++ /dev/null @@ -1,27 +0,0 @@ -# Completion for git local branch names -_git() { - - # Bail if not a git repo (or no git!) - git rev-parse --git-dir >/dev/null 2>&1 || return 1 - - # Switch on the previous word - case ${COMP_WORDS[1]} in - - # If the first word is appropriate, complete with branch/tag names - checkout|merge|rebase) - local branch - while read -r _ _ branch ; do - branch=${branch##*/} - [[ $branch == "${COMP_WORDS[COMP_CWORD]}"* ]] || continue - COMPREPLY[${#COMPREPLY[@]}]=$branch - done < <(git for-each-ref refs/heads refs/tags 2>/dev/null) - return - ;; - - # Bail if it isn't - *) - return 1 - ;; - esac -} -complete -F _git -o default git |