Skip to content

Commit cf6e7ba

Browse files
trastgitster
authored andcommitted
bash completion: factor submodules into dirty state
In the implementation of GIT_PS1_SHOWDIRTYSTATE in 738a94a (bash: offer to show (un)staged changes, 2009-02-03), I cut&pasted the git-diff invocations from dirty-worktree checks elsewhere, carrying along the --ignore-submodules option. As pointed out by Kevin Ballard, this doesn't really make sense: to the _user_, a changed submodule counts towards uncommitted changes. Signed-off-by: Thomas Rast <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c8cba79 commit cf6e7ba

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

contrib/completion/git-completion.bash

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,9 @@ __git_ps1 ()
148148
elif [ "true" = "$(git rev-parse --is-inside-work-tree 2>/dev/null)" ]; then
149149
if [ -n "${GIT_PS1_SHOWDIRTYSTATE-}" ]; then
150150
if [ "$(git config --bool bash.showDirtyState)" != "false" ]; then
151-
git diff --no-ext-diff --ignore-submodules \
152-
--quiet --exit-code || w="*"
151+
git diff --no-ext-diff --quiet --exit-code || w="*"
153152
if git rev-parse --quiet --verify HEAD >/dev/null; then
154-
git diff-index --cached --quiet \
155-
--ignore-submodules HEAD -- || i="+"
153+
git diff-index --cached --quiet HEAD -- || i="+"
156154
else
157155
i="#"
158156
fi

0 commit comments

Comments
 (0)