Files
cpl/tools/set_version/git_service.py
edraft 25b4ca0696
Some checks failed
Build on push / prepare (push) Successful in 9s
Build on push / core (push) Successful in 18s
Build on push / query (push) Successful in 25s
Build on push / translation (push) Failing after 8s
Build on push / mail (push) Successful in 14s
Added cpl-mail
2025-09-15 20:56:07 +02:00

18 lines
468 B
Python

import os
from cpl.core.environment import ApplicationEnvironmentABC
from git import Repo
class GitService:
def __init__(self, env: ApplicationEnvironmentABC):
self._env = env
self._repo = Repo(env.working_directory)
def get_active_branch_name(self) -> str:
branch = self._repo.active_branch
return branch.name
def get_diff_files(self) -> list[str]:
return [item.a_path for item in self._repo.index.diff(None)]