diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-01-25 12:04:24 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-01-25 12:06:21 +1300 |
commit | dc0ba282b6e41c1c4b2dfba2ea362cf88a7f8c29 (patch) | |
tree | e7d9d68a0e0e68209857ec0d0373f766d8c8ec93 | |
parent | Add an issue (diff) | |
download | dotfiles-dc0ba282b6e41c1c4b2dfba2ea362cf88a7f8c29.tar.gz dotfiles-dc0ba282b6e41c1c4b2dfba2ea362cf88a7f8c29.zip |
Be more specific in ref name trimming
e.g. for a namespaced branch "foo/bar/bar", don't strip the leading part
off
-rw-r--r-- | bash/bashrc.d/prompt.bash | 2 | ||||
-rw-r--r-- | ksh/kshrc.d/prompt.ksh | 2 | ||||
-rw-r--r-- | zsh/zshrc.d/prompt.zsh | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash index c954ef97..b22f118f 100644 --- a/bash/bashrc.d/prompt.bash +++ b/bash/bashrc.d/prompt.bash @@ -104,7 +104,7 @@ prompt() { git describe --tags --exact-match HEAD || git rev-parse --short HEAD ) || return - name=${name##*/} + name=${name#refs/*/} [[ -n $name ]] || return # Check various files in .git to flag processes diff --git a/ksh/kshrc.d/prompt.ksh b/ksh/kshrc.d/prompt.ksh index 925db0cf..bf77f626 100644 --- a/ksh/kshrc.d/prompt.ksh +++ b/ksh/kshrc.d/prompt.ksh @@ -100,7 +100,7 @@ function prompt { git describe --tags --exact-match HEAD || git rev-parse --short HEAD ) || return - name=${name##*/} + name=${name#refs/*/} [[ -n $name ]] || return # Check various files in .git to flag processes diff --git a/zsh/zshrc.d/prompt.zsh b/zsh/zshrc.d/prompt.zsh index a22739d3..cfac7ffd 100644 --- a/zsh/zshrc.d/prompt.zsh +++ b/zsh/zshrc.d/prompt.zsh @@ -67,7 +67,7 @@ prompt() { git describe --tags --exact-match HEAD || git rev-parse --short HEAD ) || return - name=${name##*/} + name=${name#refs/*/} [[ -n $name ]] || return # Check various files in .git to flag processes |