commands: Skip .git directories

Fix #3468
This commit is contained in:
Albert Nigmatzianov 2017-05-15 12:58:02 +02:00 committed by Bjørn Erik Pedersen
parent c7646551be
commit 94b5be67fc
1 changed files with 6 additions and 0 deletions

View 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 {