aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2014-04-27 00:01:24 +1200
committerTom Ryder <tom@sanctum.geek.nz>2014-04-27 00:01:24 +1200
commitd079ae655fb8f0a6b352e1b3205440fae47e282a (patch)
tree21bbce0e8889f1a4d6935e08799bfa03d31485a4 /bash/bashrc.d
parentAdd dummy default Makefile target (diff)
downloaddotfiles-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.bash6
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