Skip to content

Commit 73284cf

Browse files
authored
Merge pull request #485 from intersystems/fix-477
fix: avoid infinite loop
2 parents 42c7a12 + 1c0f896 commit 73284cf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cls/SourceControl/Git/Utils.cls

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,7 +1144,7 @@ ClassMethod NormalizeInternalName(ByRef name As %String, Output fromWebApp As %B
11441144
if (name [ "/") && (type = "csp") {
11451145
set cspFilename = $System.CSP.GetFileName(name)
11461146
if (cspFilename '= "") && (cspFilename [ ..TempFolder()) {
1147-
set name = ..NameToInternalName(cspFilename)
1147+
set name = ..NameToInternalName(cspFilename,,,,0)
11481148
set fromWebApp = 1
11491149
} else {
11501150
kill cspFilename
@@ -2190,7 +2190,7 @@ ClassMethod FileIsMapped(InternalName As %String) As %Boolean
21902190
NameToInternalName(name): given a Unix-style slash path relative to repo root,
21912191
returns the internal name for that file (e.g., cls/SourceControl/Git/Utils.cls -> SourceControl.Git.Utils.CLS)
21922192
*/
2193-
ClassMethod NameToInternalName(Name, IgnorePercent = 1, IgnoreNonexistent = 1, Verbose As %Boolean = 0) As %String
2193+
ClassMethod NameToInternalName(Name, IgnorePercent = 1, IgnoreNonexistent = 1, Verbose As %Boolean = 0, normalize As %Boolean = 1) As %String
21942194
{
21952195
set InternalName=""
21962196
set Deleted = 0
@@ -2206,7 +2206,7 @@ ClassMethod NameToInternalName(Name, IgnorePercent = 1, IgnoreNonexistent = 1, V
22062206
set InternalName = ##class(SourceControl.Git.File).ExternalNameToInternalName(Name)
22072207
if (InternalName '= "") && (context.IsInGitEnabledPackage) {
22082208
// Don't need mappings!
2209-
return ..NormalizeInternalName(InternalName)
2209+
return $select(normalize:..NormalizeInternalName(InternalName),1:InternalName)
22102210
}
22112211
} else {
22122212
// check for file in uncommitted queue
@@ -2349,7 +2349,7 @@ ClassMethod NameToInternalName(Name, IgnorePercent = 1, IgnoreNonexistent = 1, V
23492349
}
23502350
if ((IgnorePercent)&&($extract(InternalName)="%")) { set InternalName = "" } // don't return a result for % items if instructed to ignore them
23512351
if ((IgnoreNonexistent)&&('##class(%RoutineMgr).Exists(InternalName))&&('Deleted)) { set InternalName = "" } // only return item names which exist in the DB
2352-
quit ..NormalizeInternalName(InternalName)
2352+
return $select(normalize:..NormalizeInternalName(InternalName),1:InternalName)
23532353
}
23542354

23552355
ClassMethod OutputConfigureMessage()

0 commit comments

Comments
 (0)