status-all script now also displays branch name when not main/dev.

This commit is contained in:
2024-07-02 14:31:07 -04:00
parent 1a1ef6b758
commit 53ef274cba
+7
View File
@@ -42,10 +42,17 @@ function process_git_status () {
cd "$location"
output=""
info=$(git -c color.status=always status)
branch=$(git branch --show-current)
remote=$(git remote -vv)
upstream=$(git for-each-ref --format='%(upstream)' $(cat .git/HEAD))
# 33 is yellow text
# show name of branch unless on main or dev (also ignore blank '', for detached head)
if [[ "$branch" != "" ]] && [[ "$branch" != "main" ]] && [[ "$branch" != "dev" ]]; then
# 1;34 is bright blue
output="$output\n *  on branch '$branch' "
fi
# display any tracking issue, 43 is yellow background
if [[ "$remote" == "" ]]; then
output="$output\n *  no upstream repo "