diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2014-04-27 00:01:24 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2014-04-27 00:01:24 +1200 |
commit | d079ae655fb8f0a6b352e1b3205440fae47e282a (patch) | |
tree | 21bbce0e8889f1a4d6935e08799bfa03d31485a4 /bash/bashrc.d | |
parent | Add dummy default Makefile target (diff) | |
download | dotfiles-d079ae655fb8f0a6b352e1b3205440fae47e282a.tar.gz dotfiles-d079ae655fb8f0a6b352e1b3205440fae47e282a.zip |
Check first word, not previous word, for git cmd
Diffstat (limited to 'bash/bashrc.d')
-rw-r--r-- | bash/bashrc.d/git.bash | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bash/bashrc.d/git.bash b/bash/bashrc.d/git.bash index fa40eddf..ba45d4ad 100644 --- a/bash/bashrc.d/git.bash +++ b/bash/bashrc.d/git.bash @@ -13,12 +13,12 @@ _git() { # Get current and previous word local word=${COMP_WORDS[COMP_CWORD]} - local prev=${COMP_WORDS[COMP_CWORD-1]} + local first=${COMP_WORDS[1]} # Switch on the previous word - case $prev in + case $first in - # If the previous word is appropriate, complete with branch/tag names + # If the first word is appropriate, complete with branch/tag names checkout|merge|rebase) local -a branches local branch |