Skip to content

Commit a45e563

Browse files
committed
fix: proper behavior for nonexistent files
Also skip the directory scan because it'd be slow and is generally unnecessary.
1 parent ca157b7 commit a45e563

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

cls/SourceControl/Git/Utils.cls

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -635,12 +635,12 @@ ClassMethod ExternalName(InternalName As %String, ByRef MappingExists As %Boolea
635635
set file = $Replace(..Name(.InternalName,.MappingExists),"/",..#Slash)
636636
set fullFile = root_file
637637
if '..Exists(.fullFile) {
638-
quit ""
638+
quit file
639639
}
640640
quit $Piece(fullFile,root,2,*)
641641
}
642642

643-
/// Check if file exists but case insensitive
643+
/// Check if file exists but case insensitive on file extension
644644
/// Stolen from %IPM.Utils.File
645645
ClassMethod Exists(ByRef pFilename) As %Boolean
646646
{
@@ -660,15 +660,6 @@ ClassMethod Exists(ByRef pFilename) As %Boolean
660660
Return 1
661661
}
662662
}
663-
set tNameLower = $$$LOWER(tName)
664-
Set rs = ##class(%File).FileSetFunc(tDirectory, "*", , 0)
665-
While rs.%Next() {
666-
set tItemNameLower = $$$LOWER(rs.ItemName)
667-
If tItemNameLower = tNameLower {
668-
Set pFilename = tDirectory _ rs.ItemName
669-
Return 1
670-
}
671-
}
672663
Return 0
673664
}
674665

@@ -2731,3 +2722,4 @@ ClassMethod BaselineExport(pCommitMessage = "", pPushToRemote = "") As %Status
27312722
}
27322723

27332724
}
2725+

0 commit comments

Comments
 (0)