diff options
author | Bjørn Erik Pedersen <[email protected]> | 2024-02-28 17:58:27 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2024-02-28 19:26:55 +0100 |
commit | 4a502f7eb475afa35849b3dcf312daf3e3832d51 (patch) | |
tree | e2eb5855e0f6c8e20537e4f81b8bd7601a0dc66f /hugofs | |
parent | be1dbba0f78f2cf7f7019c01cc8705fa339ea995 (diff) | |
download | hugo-4a502f7eb475afa35849b3dcf312daf3e3832d51.tar.gz hugo-4a502f7eb475afa35849b3dcf312daf3e3832d51.zip |
Fix assets vs data issue
And possibly some other related file mount issues.
Fixes #12133
Diffstat (limited to 'hugofs')
-rw-r--r-- | hugofs/rootmapping_fs.go | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/hugofs/rootmapping_fs.go b/hugofs/rootmapping_fs.go index 04c5b4a72..a5bf9aadf 100644 --- a/hugofs/rootmapping_fs.go +++ b/hugofs/rootmapping_fs.go @@ -43,7 +43,6 @@ var _ ReverseLookupProvder = (*RootMappingFs)(nil) func NewRootMappingFs(fs afero.Fs, rms ...RootMapping) (*RootMappingFs, error) { rootMapToReal := radix.New() realMapToRoot := radix.New() - var virtualRoots []RootMapping addMapping := func(key string, rm RootMapping, to *radix.Tree) { var mappings []RootMapping @@ -154,11 +153,8 @@ func NewRootMappingFs(fs afero.Fs, rms ...RootMapping) (*RootMappingFs, error) { addMapping(rev, rm, realMapToRoot) - virtualRoots = append(virtualRoots, rm) } - rootMapToReal.Insert(filepathSeparator, virtualRoots) - rfs := &RootMappingFs{ Fs: fs, rootMapToReal: rootMapToReal, @@ -414,6 +410,7 @@ func (fs *RootMappingFs) getRoots(key string) (string, []RootMapping) { for { var found bool ss, vv, found := tree.LongestPrefix(key) + if !found || (levels < 2 && ss == key) { break } |