newvers.sh: avoid bare git invocation

git may not be in the path, and $git_cmd includes some commandline
arguments.

Reported by:	mjg
Tested by:	mjg
This commit is contained in:
Ed Maste 2021-01-21 10:00:20 -05:00
parent 0c864213ef
commit 9e98065cf1

View File

@ -252,7 +252,7 @@ fi
if [ -n "$git_cmd" ] ; then
git=$($git_cmd rev-parse --verify --short HEAD 2>/dev/null)
if [ "$(git rev-parse --is-shallow-repository)" = false ] ; then
if [ "$($git_cmd rev-parse --is-shallow-repository)" = false ] ; then
git_cnt=$($git_cmd rev-list --count HEAD 2>/dev/null)
if [ -n "$git_cnt" ] ; then
git="c${git_cnt}-g${git}"