summaryrefslogtreecommitdiffhomepage
path: root/commands
diff options
context:
space:
mode:
authorAlbert Nigmatzianov <[email protected]>2017-05-15 12:58:02 +0200
committerBjørn Erik Pedersen <[email protected]>2017-05-15 14:38:04 +0300
commit94b5be67fc73b87d114d94a7bb1a33ab997f30f1 (patch)
treea2f64bfe4aaf430dea52b12da552056f778c044f /commands
parentc7646551bed0cfe81aa0581d7b50f46bb77aa2a8 (diff)
downloadhugo-94b5be67fc73b87d114d94a7bb1a33ab997f30f1.tar.gz
hugo-94b5be67fc73b87d114d94a7bb1a33ab997f30f1.zip
commands: Skip .git directories
Fix #3468
Diffstat (limited to 'commands')
-rw-r--r--commands/hugo.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/commands/hugo.go b/commands/hugo.go
index b7bc863a4..3f711251e 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 {