From: Albert Nigmatzianov Date: Mon, 15 May 2017 10:58:02 +0000 (+0200) Subject: commands: Skip .git directories X-Git-Tag: v0.21~27 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=94b5be67fc73b87d114d94a7bb1a33ab997f30f1;p=brevno-suite%2Fhugo commands: Skip .git directories Fix #3468 --- diff --git a/commands/hugo.go b/commands/hugo.go index b7bc863a..3f711251 100644 --- a/commands/hugo.go +++ b/commands/hugo.go @@ -663,6 +663,12 @@ func (c *commandeer) getDirList() []string { return nil } + // Skip .git directories. + // Related to https://github.com/spf13/hugo/issues/3468. + if fi.Name() == ".git" { + return nil + } + if fi.Mode()&os.ModeSymlink == os.ModeSymlink { link, err := filepath.EvalSymlinks(path) if err != nil {