git: 617c700abae7 - main - newvers.sh: Report -dirty also with staged changes

From: Ed Maste <emaste_at_FreeBSD.org>
Date: Thu, 15 Oct 2026 17:24:39 UTC
The branch main has been updated by emaste:

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

commit 617c700abae7aba74777fca137458395936f5053
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2026-10-14 12:42:40 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2026-10-15 17:24:13 +0000

    newvers.sh: Report -dirty also with staged changes
    
    We add -dirty to the uname version string if the tree does not match the
    reported hash. Previously, staged but uncommitted changes were ignored.
    Noted by naddy@ in D60606.
    
    Reviewed by:    cperciva, imp
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D60722
---
 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 de696a192853..122bb818d2cc 100644
--- a/sys/conf/newvers.sh
+++ b/sys/conf/newvers.sh
@@ -179,7 +179,7 @@ findvcs()
 
 git_tree_modified()
 {
-	! $git_cmd "--work-tree=${VCSTOP}" -c core.checkStat=minimal -c core.fileMode=off diff --quiet
+	! $git_cmd "--work-tree=${VCSTOP}" -c core.checkStat=minimal -c core.fileMode=off diff --quiet HEAD
 }
 
 LC_ALL=C; export LC_ALL