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 <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Thomas Rast committed
Dec 31, 2009 at 12:48 UTC
cf6e7ba1c4c29fda3f16bfd4a4f1995ed45082d5
1 file changed
+2
-4
contrib/completion/git-completion.bash
+2
-4
@@ -148,11 +148,9 @@ __git_ps1 ()
148
elif [ "true" = "$(git rev-parse --is-inside-work-tree 2>/dev/null)" ]; then
149
if [ -n "${GIT_PS1_SHOWDIRTYSTATE-}" ]; then
150
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="*"
152
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="+"
154
else
155
i="#"
156
fi