git prompt: use toplevel to find untracked files
[gitweb.git] / contrib / completion / git-prompt.sh
index 9d684b10a67ea663410db3ba68482c1a52bbc367..10c4d0ad74bc072afc86440c8810e2c3faae00ba 100644 (file)
@@ -474,7 +474,7 @@ __git_ps1 ()
 
                if [ -n "${GIT_PS1_SHOWUNTRACKEDFILES-}" ] &&
                   [ "$(git config --bool bash.showUntrackedFiles)" != "false" ] &&
-                  git ls-files --others --exclude-standard --error-unmatch -- '*' >/dev/null 2>/dev/null
+                  git ls-files --others --exclude-standard --error-unmatch -- ':/*' >/dev/null 2>/dev/null
                then
                        u="%${ZSH_VERSION+%}"
                fi