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 <gps949@outlook.com>
This commit is contained in:
Chenyang Gao 2023-05-07 15:20:29 +08:00 committed by Brad Fitzpatrick
parent df8b1b2179
commit e8b06b2232

View File

@ -131,7 +131,7 @@ func (i embeddedInfo) commitAbbrev() string {
ret.commitDate = strings.ReplaceAll(ret.commitDate, "-", "")
}
case "vcs.modified":
ret.dirty = true
ret.dirty = s.Value == "true"
}
}
if ret.commit == "" || ret.commitDate == "" {