Skip to content

Inconsistent handling of file extensions #727

Closed
@RalphGauer-Paul

Description

@RalphGauer-Paul

When a file is added to source control (e.g. "murks.int") this is done internally by calling ##class(SourceControl.Git.Utils).AddToSourceControl() which calls ##class(SourceControl.Git.Utils).NormalizeExtension() to convert the file extension to lowercase and adds an entry to ^SYS("SourceControl","Git","items"...).
The function ##class(SourceControl.Git.Utils).GitStatus() is called, too, and if an internal name is found to an external name, it sets an entry in ^SYS after calling ##class(SourceControl.Git.Utils).NormalizeInternalName() which converts the file extension to uppercase.
This leads to two entries in ^SYS:

^SYS("SourceControl","Git","items","murks.INT") = ""
^SYS("SourceControl","Git","items","murks.int") = ""

Thus calling "Export All (Force)" exports each file twice.
Removing a file from source control with ##class(SourceControl.Git.Utils).RemoveFromSourceControl() removes only the entry with lowercase extension, so "Export All (Force)" is still trying to export "murks.INT".
When the file is deleted, "Export All (Force)" will fail, because it cannot find the file though it is listed in ^SYS

In order to have this work consistently ##class(SourceControl.Git.Utils).NormalizeInternalName() should convert the extension to lowercase, too.
Before:

    if ($extract(name) '= "/") && (type'="csp") {
        quit $piece(name,".",1,*-1)_"."_$zconvert($piece(name,".",*),"U")
    }

After:

    if ($extract(name) '= "/") && (type'="csp") {
        quit $piece(name,".",1,*-1)_"."_$zconvert($piece(name,".",*),"L")
    }

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions