git: 1be967ac4e2d - stable/15 - newvers.sh: Report -dirty also with staged changes

From: Colin Percival <cperciva_at_FreeBSD.org>
Date: Wed, 28 Oct 2026 05:52:43 UTC
The branch stable/15 has been updated by cperciva:

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

commit 1be967ac4e2d981e5a8c9b4abb17b26ec3fb380f
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2026-10-14 12:42:40 +0000
Commit:     Colin Percival <cperciva@FreeBSD.org>
CommitDate: 2026-10-28 05:46:31 +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
    
    (cherry picked from commit 617c700abae7aba74777fca137458395936f5053)
---
 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 dae4cab3f3d1..543d63114af3 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
 }
 
 got_tree_modified()