aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-08-31 13:06:37 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-08-31 13:06:37 +1200
commit1db44285016060c02353365ca9f6cdd0d442dded (patch)
tree2e60a49ce946d8835cdc97a109d4426e841e36fe /bash/bashrc.d
parent0ac1a9c2f9bf3e929ecec510d34bbb3aa6f5ada0 (diff)
downloaddotfiles-1db44285016060c02353365ca9f6cdd0d442dded.tar.gz
dotfiles-1db44285016060c02353365ca9f6cdd0d442dded.zip
Move git index update higher up
Diffstat (limited to 'bash/bashrc.d')
-rw-r--r--bash/bashrc.d/prompt.bash6
1 files changed, 3 insertions, 3 deletions
diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash
index e8429b26..843c5ce4 100644
--- a/bash/bashrc.d/prompt.bash
+++ b/bash/bashrc.d/prompt.bash
@@ -101,6 +101,9 @@ prompt() {
iswt=$(git rev-parse --is-inside-work-tree 2>/dev/null)
[[ $iswt = true ]] || return
+ # Refresh index so e.g. git-diff-files(1) is accurate
+ git update-index --refresh >/dev/null
+
# Find a local branch, remote branch, or tag (annotated or not), or
# failing all of that just show the short commit ID, in that order
# of preference; if none of that works, bail out
@@ -110,9 +113,6 @@ prompt() {
name=${name##*/}
[[ -n $name ]] || return
- # Refresh index so e.g. git-diff-files(1) is accurate
- git update-index --refresh >/dev/null
-
# Check various files in .git to flag processes
local proc
[[ -d .git/rebase-merge || -d .git/rebase-apply ]] &&