mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-30 22:39:58 +02:00
Fix a rebuild on resource rename case
This commit is contained in:
@@ -738,15 +738,15 @@ type pathChange struct {
|
||||
// The path to the changed file.
|
||||
p *paths.Path
|
||||
|
||||
// If true, this is a delete operation (a delete or a rename).
|
||||
delete bool
|
||||
// If true, this is a structural change (e.g. a delete or a rename).
|
||||
structural bool
|
||||
|
||||
// If true, this is a directory.
|
||||
isDir bool
|
||||
}
|
||||
|
||||
func (p pathChange) isStructuralChange() bool {
|
||||
return p.delete || p.isDir
|
||||
return p.structural || p.isDir
|
||||
}
|
||||
|
||||
func (h *HugoSites) processPartialRebuildChanges(ctx context.Context, l logg.LevelLogger, config *BuildCfg) error {
|
||||
@@ -912,7 +912,7 @@ func (h *HugoSites) processPartialFileEvents(ctx context.Context, l logg.LevelLo
|
||||
}
|
||||
}
|
||||
|
||||
addedOrChangedContent = append(addedOrChangedContent, pathChange{p: pathInfo, delete: delete, isDir: isDir})
|
||||
addedOrChangedContent = append(addedOrChangedContent, pathChange{p: pathInfo, structural: delete, isDir: isDir})
|
||||
|
||||
case files.ComponentFolderLayouts:
|
||||
tmplChanged = true
|
||||
@@ -1033,6 +1033,16 @@ func (h *HugoSites) processPartialFileEvents(ctx context.Context, l logg.LevelLo
|
||||
handleChange(id, false, true)
|
||||
}
|
||||
|
||||
for _, id := range changes {
|
||||
if id == identity.GenghisKhan {
|
||||
for i, cp := range addedOrChangedContent {
|
||||
cp.structural = true
|
||||
addedOrChangedContent[i] = cp
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
resourceFiles := h.fileEventsContentPaths(addedOrChangedContent)
|
||||
|
||||
changed := &WhatChanged{
|
||||
|
Reference in New Issue
Block a user