diff --git a/CHANGELOG.md b/CHANGELOG.md index 94231c17..35605b0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.9.1] - Unreleased + +### Fixed +- Embedded Git commits settings when cloning empty repo to avert any issues + ## [2.9.0] - 2025-01-09 ### Added diff --git a/cls/SourceControl/Git/Settings.cls b/cls/SourceControl/Git/Settings.cls index 2171b9f0..02aa8bf4 100644 --- a/cls/SourceControl/Git/Settings.cls +++ b/cls/SourceControl/Git/Settings.cls @@ -448,6 +448,15 @@ Method OnAfterConfigure() As %Boolean $$$ThrowOnError(workMgr.WaitForComplete()) // export settings file without committing $$$ThrowOnError(..SaveWithSourceControl()) + + // Empty repo breaks Embedded Git, commit the settings file + do ##class(SourceControl.Git.Utils).RunGitCommandWithInput("log",,.errStream,.outStream) + do errStream.Rewind() + if (errStream.Read() [ "does not have any commits yet") { + w !,"Cloned Empty Repository, committing initial source control settings",! + $$$ThrowOnError(##class(SourceControl.Git.Utils).AddToSourceControl(##class(SourceControl.Git.Settings.Document).#INTERNALNAME)) + $$$ThrowOnError(##class(SourceControl.Git.Utils).Commit(##class(SourceControl.Git.Settings.Document).#INTERNALNAME,"initial commit")) + } } } } diff --git a/module.xml b/module.xml index 7702e998..d34cbb56 100644 --- a/module.xml +++ b/module.xml @@ -3,7 +3,7 @@ git-source-control - 2.9.0 + 2.9.1 Server-side source control extension for use of Git on InterSystems platforms git source control studio vscode module