From a1df7fa8cc5301684ae8eb8bc2852a05531b7816 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sat, 29 Aug 2020 02:30:14 +0300 Subject: [PATCH] Feat(bash-prompt): Reorder signs: `*+$%` Order signs the same way `__git_ps1` does. --- admin/prog/bash_prompt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/admin/prog/bash_prompt b/admin/prog/bash_prompt index f379668..e04e6e8 100644 --- a/admin/prog/bash_prompt +++ b/admin/prog/bash_prompt @@ -40,19 +40,14 @@ prompt_git() { # ensure index is up to date #git update-index --really-refresh -q &>/dev/null - # check for uncommitted changes in the index - if ! $(git diff --quiet --ignore-submodules --cached); then - s="$s+"; - fi - # check for unstaged changes if [ -n "$(git ls-files --modified)" ]; then s="$s*"; fi - # check for untracked files - if [ -n "$(git ls-files --others --exclude-standard)" ]; then - s="$s%"; + # check for uncommitted changes in the index + if ! $(git diff --quiet --ignore-submodules --cached); then + s="$s+"; fi # check for stashed files @@ -60,6 +55,11 @@ prompt_git() { s="$s$"; fi + # check for untracked files + if [ -n "$(git ls-files --others --exclude-standard)" ]; then + s="$s%"; + fi + fi # get the short symbolic ref -- 2.39.5