commands: Skip .git directories
authorAlbert Nigmatzianov <albertnigma@gmail.com>
Mon, 15 May 2017 10:58:02 +0000 (12:58 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Mon, 15 May 2017 11:38:04 +0000 (14:38 +0300)
Fix #3468

commands/hugo.go

index b7bc863a4e9068b4dc1b8d0d8d9fd679be46b1c2..3f711251ec9cd3bd8986a8797b2ec085bfcf9422 100644 (file)
@@ -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 {