mirror of
https://github.com/Dictionarry-Hub/profilarr.git
synced 2026-01-26 04:42:00 +01:00
refactor: move git operations into seperate files
This commit is contained in:
16
backend/app/git/operations/commit.py
Normal file
16
backend/app/git/operations/commit.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# git/operations/commit.py
|
||||
|
||||
import git
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
def commit_changes(repo_path, files, message):
|
||||
try:
|
||||
repo = git.Repo(repo_path)
|
||||
repo.index.add(files)
|
||||
repo.index.commit(message)
|
||||
return True, "Successfully committed changes."
|
||||
except Exception as e:
|
||||
logger.error(f"Error committing changes: {str(e)}", exc_info=True)
|
||||
return False, f"Error committing changes: {str(e)}"
|
||||
Reference in New Issue
Block a user