diff options
author | Bjørn Erik Pedersen <[email protected]> | 2022-01-26 17:48:50 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2022-01-26 20:32:13 +0100 |
commit | 7a080b624e73fe3a10cfab9ee4fa8e9b7e7c31ad (patch) | |
tree | ea6ad75692fadf5478f3c2e6b94268bbf337eb16 /hugofs | |
parent | 2655739940d8148ef374248e867b44d87cd63edf (diff) | |
download | hugo-7a080b624e73fe3a10cfab9ee4fa8e9b7e7c31ad.tar.gz hugo-7a080b624e73fe3a10cfab9ee4fa8e9b7e7c31ad.zip |
Fix duplicate mount sources
Fixes #9426
Diffstat (limited to 'hugofs')
-rw-r--r-- | hugofs/walk.go | 2 | ||||
-rw-r--r-- | hugofs/walk_test.go | 6 |
2 files changed, 2 insertions, 6 deletions
diff --git a/hugofs/walk.go b/hugofs/walk.go index 44d58f060..c02d36671 100644 --- a/hugofs/walk.go +++ b/hugofs/walk.go @@ -270,7 +270,7 @@ func (w *Walkway) walk(path string, info FileMetaInfo, dirEntries []FileMetaInfo meta.Path = normalizeFilename(pathMeta) meta.PathWalk = pathn - if fim.IsDir() && w.isSeen(meta.Filename) { + if fim.IsDir() && meta.IsSymlink && w.isSeen(meta.Filename) { // Prevent infinite recursion // Possible cyclic reference meta.SkipDir = true diff --git a/hugofs/walk_test.go b/hugofs/walk_test.go index 4825ba36e..2d9ec784d 100644 --- a/hugofs/walk_test.go +++ b/hugofs/walk_test.go @@ -81,14 +81,12 @@ func TestWalkRootMappingFs(t *testing.T) { } c.Run("Basic", func(c *qt.C) { - bfs := prepare(c) names, err := collectFilenames(bfs, "", "") c.Assert(err, qt.IsNil) c.Assert(names, qt.DeepEquals, []string{"a/test.txt", "b/test.txt", "c/test.txt"}) - }) c.Run("Para", func(c *qt.C) { @@ -112,12 +110,10 @@ func TestWalkRootMappingFs(t *testing.T) { return errors.New("fail") } return nil - }) } c.Assert(r.Wait(), qt.IsNil) - }) } @@ -169,7 +165,7 @@ func TestWalkSymbolicLink(t *testing.T) { names, err := collectFilenames(fs, workDir, workDir) c.Assert(err, qt.IsNil) - c.Assert(names, qt.DeepEquals, []string{"blog/real/sub/a.txt", "docs/b.txt"}) + c.Assert(names, qt.DeepEquals, []string{"blog/real/sub/a.txt", "blog/symlinked/sub/a.txt", "docs/b.txt"}) }) t.Run("BasePath Fs", func(t *testing.T) { |