git: bb4cbe9b9e61 - stable/12 - newvers.sh: avoid bare git invocation

From: Ed Maste <emaste_at_FreeBSD.org>
Date: Mon, 19 Sep 2022 18:34:51 UTC
The branch stable/12 has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=bb4cbe9b9e61246604669a75809dcd316c8661c1

commit bb4cbe9b9e61246604669a75809dcd316c8661c1
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2021-01-21 15:00:20 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2022-09-19 18:18:58 +0000

    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
    
    (cherry picked from commit 9e98065cf17d0e4831928a5acbd7bc75a351c7f6)
---
 sys/conf/newvers.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh
index f8511a3f5912..e5a36c449643 100644
--- a/sys/conf/newvers.sh
+++ b/sys/conf/newvers.sh
@@ -221,7 +221,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 --first-parent --count HEAD 2>/dev/null)
 		if [ -n "$git_cnt" ] ; then
 			git="n${git_cnt}-${git}"