From f1c39a568c0dd5a03396ec1e86d802d79c5b9f11 Mon Sep 17 00:00:00 2001 From: Lucas Date: Sun, 3 May 2020 14:55:57 +0000 Subject: [PATCH] shgit: use IFS correctly --- utils/shgit | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/utils/shgit b/utils/shgit index 0ce738d..4c7ffd9 100644 --- a/utils/shgit +++ b/utils/shgit @@ -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}