Skip to content

Commit 0af9f7e

Browse files
szederpeff
authored andcommitted
bash prompt: remove a redundant 'git diff' option
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 <[email protected]> Signed-off-by: Jeff King <[email protected]>
1 parent a30d11e commit 0af9f7e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contrib/completion/git-prompt.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ __git_ps1 ()
476476
if [ -n "${GIT_PS1_SHOWDIRTYSTATE-}" ] &&
477477
[ "$(git config --bool bash.showDirtyState)" != "false" ]
478478
then
479-
git diff --no-ext-diff --quiet --exit-code || w="*"
479+
git diff --no-ext-diff --quiet || w="*"
480480
if [ -n "$short_sha" ]; then
481481
git diff-index --cached --quiet HEAD -- || i="+"
482482
else

0 commit comments

Comments
 (0)