From a010544200d1781f6a87e88068c77d420069583d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Guillot?= Date: Sat, 16 Aug 2025 12:13:30 -0700 Subject: [PATCH] fix(version): be explicit when VCS info is unavailable --- internal/version/version.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/internal/version/version.go b/internal/version/version.go index 69bd7d1e..9bd8f3c8 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -5,7 +5,6 @@ package version // import "miniflux.app/v2/internal/version" import ( "runtime/debug" - "time" ) // Variables populated at build time. @@ -19,11 +18,14 @@ func getCommit() string { if info, ok := debug.ReadBuildInfo(); ok { for _, setting := range info.Settings { if setting.Key == "vcs.revision" { - return setting.Value[:8] // Short commit hash + if len(setting.Value) >= 8 { + return setting.Value[:8] + } + return setting.Value } } } - return "HEAD" + return "Unknown (built outside VCS)" } func getBuildDate() string { @@ -34,5 +36,5 @@ func getBuildDate() string { } } } - return time.Now().Format(time.RFC3339) + return "Unknown (built outside VCS)" }