Skip to content

Commit

Permalink
bash prompt: remove a redundant 'git diff' option
Browse files Browse the repository at this point in the history
To get the dirty state indicator __git_ps1() runs 'git diff' with
'--quiet --exit-code' options.  '--quiet' already implies
'--exit-code', so the latter is unnecessary and can be removed.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Jeff King <peff@peff.net>
  • Loading branch information
SZEDER Gábor authored and Jeff King committed Nov 24, 2015
1 parent a30d11e commit 0af9f7e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contrib/completion/git-prompt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ __git_ps1 ()
if [ -n "${GIT_PS1_SHOWDIRTYSTATE-}" ] &&
[ "$(git config --bool bash.showDirtyState)" != "false" ]
then
git diff --no-ext-diff --quiet --exit-code || w="*"
git diff --no-ext-diff --quiet || w="*"
if [ -n "$short_sha" ]; then
git diff-index --cached --quiet HEAD -- || i="+"
else
Expand Down

0 comments on commit 0af9f7e

Please sign in to comment.