aboutsummaryrefslogtreecommitdiffstats
path: root/prog/meta.go
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2024-10-20 22:40:52 +0200
committerTaras Madan <tarasmadan@google.com>2024-10-25 12:08:02 +0000
commit350e853bc999ed32f877a99d892144bfbc60d60c (patch)
treeb7bbad1377ce39a4752f962d818e07b490f88dc4 /prog/meta.go
parentc0aa87d6da9bb0a5b04e70e4d2bb3cd187c566b6 (diff)
prog: let explicitly check whether git revision is known
There was a bug in syz-manager because of that. Fix it by introducing a new method in prog.
Diffstat (limited to 'prog/meta.go')
-rw-r--r--prog/meta.go14
1 files changed, 10 insertions, 4 deletions
diff --git a/prog/meta.go b/prog/meta.go
index 61e0c7edb..5c23627df 100644
--- a/prog/meta.go
+++ b/prog/meta.go
@@ -8,13 +8,19 @@ import (
"time"
)
+const defaultGitRevision = "unknown"
+
var (
- GitRevision = "unknown" // emitted by Makefile, may contain + at the end
- GitRevisionBase string // without +
- gitRevisionDate string // emitted by Makefile
- GitRevisionDate time.Time // parsed from gitRevisionDate
+ GitRevision = defaultGitRevision // emitted by Makefile, may contain + at the end
+ GitRevisionBase string // without +
+ gitRevisionDate string // emitted by Makefile
+ GitRevisionDate time.Time // parsed from gitRevisionDate
)
+func GitRevisionKnown() bool {
+ return GitRevision != defaultGitRevision
+}
+
func init() {
GitRevisionBase = strings.Replace(GitRevision, "+", "", -1)
if gitRevisionDate != "" {