update repo manager to work of master not main #22

Merged
armistace merged 1 commits from git-creation-issue into master 2026-04-29 21:58:43 +10:00

View File

@ -42,7 +42,7 @@ class GitRepository:
print(f"Cloning failed: {e}") print(f"Cloning failed: {e}")
return False return False
def fetch(self, remote_name="origin", ref_name="main"): def fetch(self, remote_name="origin", ref_name="master"):
"""Fetch updates from a remote repository with authentication""" """Fetch updates from a remote repository with authentication"""
try: try:
self.repo.remotes[remote_name].fetch(ref_name=ref_name) self.repo.remotes[remote_name].fetch(ref_name=ref_name)
@ -51,7 +51,7 @@ class GitRepository:
print(f"Fetching failed: {e}") print(f"Fetching failed: {e}")
return False return False
def pull(self, remote_name="origin", ref_name="main"): def pull(self, remote_name="origin", ref_name="master"):
"""Pull updates from a remote repository with authentication""" """Pull updates from a remote repository with authentication"""
print("Pulling Latest Updates (if any)") print("Pulling Latest Updates (if any)")
try: try:
@ -93,8 +93,8 @@ class GitRepository:
self.repo.git.checkout(title) self.repo.git.checkout(title)
self.pull(ref_name=title) self.pull(ref_name=title)
else: else:
# New branch, create from main # New branch, create from master
self.repo.git.checkout("-b", title, "origin/main") self.repo.git.checkout("-b", title, "origin/master")
# Ensure destination directory exists # Ensure destination directory exists
dest_dir = f"{self.repo_path}src/content/" dest_dir = f"{self.repo_path}src/content/"