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" {
rev = setting.Value + rev
}
if setting.Key == "vcs.modified" {
if setting.Key == "vcs.modified" && setting.Value == "true" {
rev = rev + "-dirty"
}
}

View File

@ -2,7 +2,6 @@ package web
import (
"net/http"
"runtime/debug"
"sort"
"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]})
}
rev := ""
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"
}
}
}
rev := core.GetRevInfo()
data := html.HomeData{
Channels: channelData,