Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-06-16 19:58:40 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-06-16 19:58:40 +0300
commit31fb29fb3f306678f3697e05bbccefb2078d7f78 (patch)
tree716f2586c71abf1f49dc9e1fec450c4b7796ab6e /hugolib
parentd392893cd73dc00c927f342778f6dca9628d328e (diff)
Do not read config from os.Environ when running tests
Fixes #8655
Diffstat (limited to 'hugolib')
-rw-r--r--hugolib/config.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/hugolib/config.go b/hugolib/config.go
index f559d7fd3..deba8abe6 100644
--- a/hugolib/config.go
+++ b/hugolib/config.go
@@ -55,7 +55,7 @@ func LoadConfig(d ConfigSourceDescriptor, doWithConfig ...func(cfg config.Provid
d.Environment = hugo.EnvironmentProduction
}
- if len(d.Environ) == 0 {
+ if len(d.Environ) == 0 && !hugo.IsRunningAsTest() {
d.Environ = os.Environ()
}