mirror of
https://github.com/Dictionarry-Hub/profilarr.git
synced 2026-01-22 10:51:02 +01:00
refactor: move git operations into seperate files
This commit is contained in:
15
backend/app/git/operations/pull.py
Normal file
15
backend/app/git/operations/pull.py
Normal file
@@ -0,0 +1,15 @@
|
||||
# git/operations/pull.py
|
||||
|
||||
import git
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
def pull_branch(repo_path, branch_name):
|
||||
try:
|
||||
repo = git.Repo(repo_path)
|
||||
repo.git.pull('origin', branch_name)
|
||||
return True, f"Successfully pulled changes for branch {branch_name}."
|
||||
except Exception as e:
|
||||
logger.error(f"Error pulling branch: {str(e)}", exc_info=True)
|
||||
return False, f"Error pulling branch: {str(e)}"
|
||||
Reference in New Issue
Block a user