From 252c042095ba25f3bc2a1c11e39190ec12cabe14 Mon Sep 17 00:00:00 2001 From: Vadim Troshchinskiy Date: Thu, 17 Jul 2025 16:38:57 +0200 Subject: [PATCH] refs #2489 Set default branch to "main" --- ogclient/lib/python3/GitLib/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ogclient/lib/python3/GitLib/__init__.py b/ogclient/lib/python3/GitLib/__init__.py index 8791b0f..1ddc079 100755 --- a/ogclient/lib/python3/GitLib/__init__.py +++ b/ogclient/lib/python3/GitLib/__init__.py @@ -349,6 +349,7 @@ class OpengnsysGitLibrary: self.repo_server = self.kernel_args["ogrepo"] self.ip_address = self.kernel_args["ip"] + self.initial_branch = "main" if not self.repo_server: self.logger.warning("ogrepo kernel argument wasn't passed, or was empty. Defaulting to oglive.") @@ -1371,7 +1372,7 @@ class OpengnsysGitLibrary: os.symlink(real_git_dir, git_dir) - with git.Repo.init(path) as repo: + with git.Repo.init(path, initial_branch = self.initial_branch) as repo: # On NTFS, we have to unmount the filesystem to do secaudit. # Gitpython objects existing at that time may mean a dangling git process that prevents # the required unmounting.