hugofs: Fix mount with hole regression

Fixes #6854
This commit is contained in:
Bjørn Erik Pedersen
2020-02-09 17:58:55 +01:00
parent 18888e09bb
commit b78576fd38
4 changed files with 129 additions and 10 deletions

View File

@@ -50,6 +50,7 @@ const (
metaKeyOpener = "opener"
metaKeyIsOrdered = "isOrdered"
metaKeyIsSymlink = "isSymlink"
metaKeyJoinStat = "joinStat"
metaKeySkipDir = "skipDir"
metaKeyClassifier = "classifier"
metaKeyTranslationBaseName = "translationBaseName"
@@ -177,6 +178,14 @@ func (f FileMeta) Open() (afero.File, error) {
return v.(func() (afero.File, error))()
}
func (f FileMeta) JoinStat(name string) (FileMetaInfo, error) {
v, found := f[metaKeyJoinStat]
if !found {
return nil, os.ErrNotExist
}
return v.(func(name string) (FileMetaInfo, error))(name)
}
func (f FileMeta) stringV(key string) string {
if v, found := f[key]; found {
return v.(string)