diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-21 11:27:47 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-21 11:27:47 +1200 |
commit | cab985614fd72c2d82e57156e16f09a79c3f19f8 (patch) | |
tree | f1be1e18c29d41474a0c727fea64271300874b9b /bash/bashrc.d | |
parent | Don't show comments in $EDITOR for git commit (diff) | |
download | dotfiles-cab985614fd72c2d82e57156e16f09a79c3f19f8.tar.gz dotfiles-cab985614fd72c2d82e57156e16f09a79c3f19f8.zip |
Resolve an issue with incorrect prompt info
From `man 1 git-config`:
> diff.autoRefreshIndex
> When using git diff to compare with work tree files, do not
> consider stat-only change as changed. Instead, silently run git
> update-index --refresh to update the cached stat information for
> paths whose contents in the work tree match the contents in the
> index. This option defaults to true. Note that this affects only
> git diff Porcelain, and not lower level diff commands such as git
> diff-files.
Diffstat (limited to 'bash/bashrc.d')
-rw-r--r-- | bash/bashrc.d/prompt.bash | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash index 081cff69..3b0578ba 100644 --- a/bash/bashrc.d/prompt.bash +++ b/bash/bashrc.d/prompt.bash @@ -122,6 +122,9 @@ prompt() { fi branch=${branch##*/} + # Refresh index so e.g. git-diff-files(1) is accurate + git update-index --refresh >/dev/null + # Collect symbols representing repository state local state if ! git diff-files --quiet ; then |