Fix dirty vcs detection
This commit is contained in:
parent
b42d425873
commit
d80ac09122
@ -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"
|
||||
}
|
||||
}
|
||||
|
13
web/root.go
13
web/root.go
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user