From 214fe58c579aeb20e7ea751bc59e4456742bb9b6 Mon Sep 17 00:00:00 2001 From: Vadim Troshchinskiy Date: Wed, 10 Sep 2025 09:30:52 +0200 Subject: [PATCH] refs #3767 -- fix branch tracking --- CHANGELOG.md | 7 +++++++ ogclient/lib/python3/GitLib/__init__.py | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 01a471c..47aa681 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ 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.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.4.6] - 2025-09-10 + +## Change + +- Oggit branch tracking + + ## [1.4.5] - 2025-09-09 ## Change diff --git a/ogclient/lib/python3/GitLib/__init__.py b/ogclient/lib/python3/GitLib/__init__.py index 0d8860a..1a24762 100755 --- a/ogclient/lib/python3/GitLib/__init__.py +++ b/ogclient/lib/python3/GitLib/__init__.py @@ -1734,6 +1734,12 @@ class OpengnsysGitLibrary: new_branch = repo.create_head(name) repo.head.reference = new_branch + + # Set the upstream + origin = repo.remotes.origin + origin.push(refspec=f"{name}:{name}") + new_branch.set_tracking_branch(origin.refs[name]) + repo.head.reset(index=True, working_tree=True) return True