Fix dirty vcs detection

This commit is contained in:
Tim Van Baak 2025-05-02 12:30:04 -07:00
parent b42d425873
commit d80ac09122
2 changed files with 2 additions and 13 deletions

View File

@ -9,7 +9,7 @@ func GetRevInfo() (rev string) {
if setting.Key == "vcs.revision" { if setting.Key == "vcs.revision" {
rev = setting.Value + rev rev = setting.Value + rev
} }
if setting.Key == "vcs.modified" { if setting.Key == "vcs.modified" && setting.Value == "true" {
rev = rev + "-dirty" rev = rev + "-dirty"
} }
} }

View File

@ -2,7 +2,6 @@ package web
import ( import (
"net/http" "net/http"
"runtime/debug"
"sort" "sort"
"github.com/Jaculabilis/intake/core" "github.com/Jaculabilis/intake/core"
@ -38,17 +37,7 @@ func (env *Env) getRoot(writer http.ResponseWriter, req *http.Request) {
channelData = append(channelData, html.ChannelData{Name: name, Active: channels[name]}) channelData = append(channelData, html.ChannelData{Name: name, Active: channels[name]})
} }
rev := "" rev := core.GetRevInfo()
if info, ok := debug.ReadBuildInfo(); ok {
for _, setting := range info.Settings {
if setting.Key == "vcs.revision" {
rev = setting.Value + rev
}
if setting.Key == "vcs.modified" {
rev = rev + "-dirty"
}
}
}
data := html.HomeData{ data := html.HomeData{
Channels: channelData, Channels: channelData,