shgit: use IFS correctly

This commit is contained in:
Lucas 2020-05-03 14:55:57 +00:00
parent 6cdd3337fd
commit f1c39a568c
1 changed files with 5 additions and 2 deletions

View File

@ -45,8 +45,11 @@ shgit()
status=${SHGIT_SEP}?
fi
IFS=" " set -- $(git rev-list --left-right --count \
@{upstream}...HEAD 2>/dev/null)
oldIFS=$IFS
IFS=" "
set -- $(git rev-list --left-right --count @{upstream}...HEAD \
2>/dev/null)
IFS=$oldIFS
commits=v${1:-0}^${2:-0}
commits=${commits#v0}
commits=${commits%^0}