From 6cb769e40c59df8a5ec65f4c2591918112e027ba 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 d9665fd..dff1887 100755 --- a/ogclient/lib/python3/GitLib/__init__.py +++ b/ogclient/lib/python3/GitLib/__init__.py @@ -348,6 +348,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.") @@ -1370,7 +1371,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.