diff options
author | Bjørn Erik Pedersen <[email protected]> | 2017-02-05 10:20:06 +0700 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2017-02-17 17:15:26 +0100 |
commit | 93ca7c9e958e34469a337e4efcc7c75774ec50fd (patch) | |
tree | 5dfa296cfe74fd5ef8f0d41ea4078704f453aa04 /hugolib/gitinfo.go | |
parent | e34af6ee30f70f5780a281e2fd8f4ed9b487ee61 (diff) | |
download | hugo-93ca7c9e958e34469a337e4efcc7c75774ec50fd.tar.gz hugo-93ca7c9e958e34469a337e4efcc7c75774ec50fd.zip |
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
Diffstat (limited to 'hugolib/gitinfo.go')
-rw-r--r-- | hugolib/gitinfo.go | 7 |
1 files changed, 3 insertions, 4 deletions
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, "") |