From e8b06b22323668b28ac4f950b8b8963922d4f8bf Mon Sep 17 00:00:00 2001 From: Chenyang Gao Date: Sun, 7 May 2023 15:20:29 +0800 Subject: [PATCH] version: properly handle vcs.modified when it's "false" Current code will set the "dirty" field of VersionInfo always "true" if vcs.modified flag is there. No matter whether the flag is "true" or "false". It will make sense to set this field due to vcs.modified value, not only the existence of the key. Signed-off-by: Chenyang Gao --- version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version/version.go b/version/version.go index 98e3892e6..424ac47db 100644 --- a/version/version.go +++ b/version/version.go @@ -131,7 +131,7 @@ var getEmbeddedInfo = lazy.SyncFunc(func() embeddedInfo { ret.commitDate = strings.ReplaceAll(ret.commitDate, "-", "") } case "vcs.modified": - ret.dirty = true + ret.dirty = s.Value == "true" } } if ret.commit == "" || ret.commitDate == "" {