From 93ca7c9e958e34469a337e4efcc7c75774ec50fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Sun, 5 Feb 2017 10:20:06 +0700 Subject: all: Refactor to nonglobal Viper, i18n etc. This is a final rewrite that removes all the global state in Hugo, which also enables the use if `t.Parallel` in tests. Updates #2701 Fixes #3016 --- hugolib/gitinfo.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'hugolib/gitinfo.go') diff --git a/hugolib/gitinfo.go b/hugolib/gitinfo.go index 82baa3250..dfa2b4dc8 100644 --- a/hugolib/gitinfo.go +++ b/hugolib/gitinfo.go @@ -20,17 +20,16 @@ import ( "github.com/bep/gitmap" "github.com/spf13/hugo/helpers" - "github.com/spf13/viper" ) func (h *HugoSites) assembleGitInfo() { - if !viper.GetBool("enableGitInfo") { + if !h.Cfg.GetBool("enableGitInfo") { return } var ( - workingDir = viper.GetString("workingDir") - contentDir = viper.GetString("contentDir") + workingDir = h.Cfg.GetString("workingDir") + contentDir = h.Cfg.GetString("contentDir") ) gitRepo, err := gitmap.Map(workingDir, "") -- cgit v1.2.3