Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed `<VALUE OUT OF RANGE>` error in GetTempFileAndRoutineTS when an OS-level error code was stored as a routine timestamp (#832)
- Fixed issue where Generated Files Read-only option didn't entirely work for files not in source control (#712)
- Fixed issue where a deleted file not within Embedded Git's management was causing the pull handler to crash and not fully update the Iris instance (#928)
- Fixed exporting items in nested subdirectories in IRIS versions >= 2025.3 (#786)

## [2.15.0] - 2026-01-06

Expand Down
2 changes: 1 addition & 1 deletion cls/SourceControl/Git/Production.cls
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ ClassMethod ExportProjectForPTD(productionClass As %String, ptdName As %String,
$$$ThrowOnError(project.%Save())
set projContentsList(exportNotesPTDName_".PTD") = ""
set projContentsList(project.Name_".PRJ") = ""
$$$ThrowOnError($System.OBJ.Export(.projContentsList, exportPath, "/diffexport=1"))
$$$ThrowOnError($System.OBJ.Export(.projContentsList, exportPath, "/diffexport=1/createdirs=1"))
// remove the LastModified timestamp from the exported file
set fileStream = ##class(%Stream.FileCharacter).%OpenId(exportPath,,.st)
$$$ThrowOnError(st)
Expand Down
2 changes: 1 addition & 1 deletion cls/SourceControl/Git/Utils.cls
Original file line number Diff line number Diff line change
Expand Up @@ -1790,7 +1790,7 @@ ClassMethod ExportItem(InternalName As %String, expand As %Boolean = 1, force As
do ..RemoveFromServerSideSourceControl(InternalName)
}
else {
$$$QuitOnError($SYSTEM.OBJ.ExportUDL(InternalName, filename,"-d/diff"))
$$$QuitOnError($SYSTEM.OBJ.ExportUDL(InternalName, filename,"-d/diff/createdirs=1"))
}
}
if (filename '= "") && ##class(%File).Exists(filename) {
Expand Down
33 changes: 33 additions & 0 deletions test/UnitTest/SourceControl/Git/Utils/ExportItem.cls
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Class UnitTest.SourceControl.Git.Utils.ExportItem Extends UnitTest.SourceControl.Git.AbstractTest
{

/// Tests that ExportItem creates intermediate directories when they don't exist
Method TestExportCreatesIntermediateDirectories()
{
set internalName = "TestGitExport.Deep.Nested.Pkg.MyClass.CLS"

// Create the class in the database so ExportItem has something to export
set classDef = ##class(%Dictionary.ClassDefinition).%New()
set classDef.Name = "TestGitExport.Deep.Nested.Pkg.MyClass"
$$$ThrowOnError(classDef.%Save())

// Determine the expected export path and ensure its directory does NOT exist yet
set filename = ##class(SourceControl.Git.Utils).FullExternalName(internalName)
set dirPath = ##class(%File).GetDirectory(filename)
if ##class(%File).DirectoryExists(dirPath) {
do ##class(%File).RemoveDirectoryTree(dirPath)
}
do $$$AssertNotTrue(##class(%File).DirectoryExists(dirPath), "Directory should not exist before export")

// Export the item - this should succeed even without pre-existing directories
do $$$AssertStatusOK(##class(SourceControl.Git.Utils).ExportItem(internalName, 0, 1))
do $$$AssertTrue(##class(%File).Exists(filename))

// Clean up
do $system.OBJ.Delete(internalName, "-d")
if ##class(%File).Exists(filename) {
do ##class(%File).Delete(filename)
}
}

}
Loading