git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/3] git-prompt.sh: fix for submodule 'dirty' indicator
@ 2017-01-22 19:30 Benjamin Fuchs
  2017-01-24  1:17 ` brian m. carlson
  0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Fuchs @ 2017-01-22 19:30 UTC (permalink / raw)
  To: git; +Cc: szeder.dev, sbeller, email

Fixing wrong git diff line.
---
 contrib/completion/git-prompt.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh
index c44b9a2..43b28e9 100644
--- a/contrib/completion/git-prompt.sh
+++ b/contrib/completion/git-prompt.sh
@@ -306,9 +306,9 @@ __git_ps1_submodule ()
 	local submodule_name="$(basename "$git_dir")"
 	if [ "$submodule_name" != ".git" ] && [ "$submodule_name" != "." ]; then
 		local parent_top="${git_dir%.git*}"
-		local submodule_top="${git_dir#*modules}"
+		local submodule_top="${git_dir#*modules/}"
 		local status=""
-		git diff -C "$parent_top" --no-ext-diff --ignore-submodules=dirty --quiet -- "$submodule_top" 2>/dev/null || status="+"
+		git -C "$parent_top" diff --no-ext-diff --ignore-submodules=dirty --quiet -- "$submodule_top" 2>/dev/null || status="+"
 		printf "$status$submodule_name:"
 	fi
 }
@@ -544,7 +544,7 @@ __git_ps1 ()
 
 	local sub=""
 	if [ -n "${GIT_PS1_SHOWSUBMODULE}" ]; then
-		sub="$(__git_ps1_submodule $g)"
+		sub="$(__git_ps1_submodule "$g")"
 	fi
 
 	local f="$w$i$s$u"
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-01-24  1:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-22 19:30 [PATCH 3/3] git-prompt.sh: fix for submodule 'dirty' indicator Benjamin Fuchs
2017-01-24  1:17 ` brian m. carlson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).