mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 05:51:39 +00:00
Move globIgnoredChildren guard before shouldDeleteUnknownInstances
The guard was placed after the early return, so when ignoreUnknownInstances was false the function exited at line 39 before ever reaching the globIgnoredChildren check. Project nodes and meta files can override ignoreUnknownInstances independently, causing incorrect deletions of glob-ignored instances.
This commit is contained in:
parent
1406c1a1b7
commit
8772077ed1
1 changed files with 7 additions and 6 deletions
|
|
@ -35,17 +35,18 @@ local SCRIPT_CLASS_NAMES = {
|
|||
}
|
||||
|
||||
local function shouldDeleteChild(virtualInstance, childInstance)
|
||||
if shouldDeleteUnknownInstances(virtualInstance) then
|
||||
return true
|
||||
end
|
||||
|
||||
-- When the parent has glob-ignored children, suppress ALL deletions
|
||||
-- (including scripts). This differs from scripts-only mode where
|
||||
-- scripts are still eligible for deletion.
|
||||
-- (including scripts) unconditionally. This must be checked before
|
||||
-- shouldDeleteUnknownInstances because project nodes and meta files
|
||||
-- can override ignoreUnknownInstances independently.
|
||||
if virtualInstance.Metadata and virtualInstance.Metadata.globIgnoredChildren then
|
||||
return false
|
||||
end
|
||||
|
||||
if shouldDeleteUnknownInstances(virtualInstance) then
|
||||
return true
|
||||
end
|
||||
|
||||
-- In scripts-only mode (where parent has ignoreUnknownInstances: true),
|
||||
-- we still want to allow deletion of scripts. This ensures deleted
|
||||
-- script files show up in the sync diff.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue