diff --git a/CHANGELOG.md b/CHANGELOG.md index 920240cd..1b286325 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fixed Import All deploying changes to files in a CSP application (#828) +- Fixed pull failure when deleted items have no internal or external name (#848) ## [2.13.0] - 2025-08-20 diff --git a/cls/SourceControl/Git/PullEventHandler/IncrementalLoad.cls b/cls/SourceControl/Git/PullEventHandler/IncrementalLoad.cls index d93f69a2..e11563ed 100644 --- a/cls/SourceControl/Git/PullEventHandler/IncrementalLoad.cls +++ b/cls/SourceControl/Git/PullEventHandler/IncrementalLoad.cls @@ -117,7 +117,7 @@ Method DeleteFile(item As %String = "", externalName As %String = "") As %Status $$$ThrowOnError(sc) } catch e { set filename = ##class(SourceControl.Git.Utils).FullExternalName(item) - if '##class(%File).Exists(filename) { + if (filename = "") || '##class(%File).Exists(filename) { do ##class(SourceControl.Git.Utils).RemoveRoutineTSH(item) // file doesn't exist anymore despite error -- should be ok set sc = $$$OK diff --git a/cls/SourceControl/Git/Utils.cls b/cls/SourceControl/Git/Utils.cls index 1ff0b905..5c835f51 100644 --- a/cls/SourceControl/Git/Utils.cls +++ b/cls/SourceControl/Git/Utils.cls @@ -1329,8 +1329,14 @@ ClassMethod UpdateRoutineTSH(InternalName As %String, tsh As %String) As %Status ClassMethod RemoveRoutineTSH(InternalName As %String) As %Status { - kill @..#Storage@("TSH", ##class(%Studio.SourceControl.Interface).normalizeName(InternalName)) - quit $$$OK + Quit:(InternalName = "") $$$OK + Set tInternalName = ##class(%Studio.SourceControl.Interface).normalizeName(InternalName) + + // Prevent a possible null subscript error + Quit:(tInternalName = "") $$$OK + Kill @..#Storage@("TSH", tInternalName) + + Quit $$$OK } ClassMethod DeleteExternalFile(InternalName As %String) As %Status