From: Oleg Broytman Date: Fri, 17 Dec 2021 15:22:28 +0000 (+0300) Subject: bash_prompt: Run `ls-files` from the root of the repo X-Git-Url: https://git.phdru.name/?p=dotfiles.git;a=commitdiff_plain;h=254e80ed9dc18935d3f0c9f7f2b70c307ff04194 bash_prompt: Run `ls-files` from the root of the repo Running `ls-files` in a subdirectory could miss files in other parts of the working tree. --- diff --git a/admin/prog/bash_prompt b/admin/prog/bash_prompt index dc6f293..0436df4 100644 --- a/admin/prog/bash_prompt +++ b/admin/prog/bash_prompt @@ -46,7 +46,7 @@ prompt_git() { #git update-index --really-refresh -q &>/dev/null # check for unstaged changes - if [ -n "$(git ls-files --modified)" ]; then + if [ -n "$(git ls-files --modified :/)" ]; then s="$s*"; fi @@ -61,7 +61,7 @@ prompt_git() { fi # check for untracked files - if [ -n "$(git ls-files --others --exclude-standard)" ]; then + if [ -n "$(git ls-files --others --exclude-standard :/)" ]; then s="$s%"; fi