shgit: quote glob characters

This commit is contained in:
Lucas 2021-01-21 03:06:17 +00:00
parent febb52129e
commit d5e94cd65e
1 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,5 @@
# shgit # shgit
# Written in 2019 by Lucas # Written in 2019,2021 by Lucas
# CC0 1.0 Universal/Public domain - No rights reserved # CC0 1.0 Universal/Public domain - No rights reserved
# #
# To the extent possible under law, the author(s) have dedicated all # To the extent possible under law, the author(s) have dedicated all
@ -21,7 +21,7 @@ shgit()
if ! name=$(git symbolic-ref -q --short HEAD); then if ! name=$(git symbolic-ref -q --short HEAD); then
name=$(git rev-parse --short HEAD 2>/dev/null) name=$(git rev-parse --short HEAD 2>/dev/null)
name=${name:-?} name=${name:-"?"}
fi fi
rb= rb=
@ -39,10 +39,10 @@ shgit()
status= status=
if [ "$worktree" = "true" ]; then if [ "$worktree" = "true" ]; then
if [ -n "$(git status --porcelain)" ]; then if [ -n "$(git status --porcelain)" ]; then
status=${SHGIT_SEP}* status=$SHGIT_SEP"*"
fi fi
else else
status=${SHGIT_SEP}? status=$SHGIT_SEP"?"
fi fi
oldIFS=$IFS oldIFS=$IFS