♻️ refactor(git.py): remove unused variable in _run\_git\_command calls

This commit is contained in:
sankalp committed 2025-06-04 09:56:34 +05:45
1 parent c3742209b8
commit 707724e0ea
1 file changed
+7 -7
+7 -7
View File
@@ -47,12 +47,12 @@ class GitService:
def get_staged_files(self) -> List[str]: def get_staged_files(self) -> List[str]:
"""Get list of staged files.""" """Get list of staged files."""
stdout, _ = self._run_git_command(["diff", "--cached", "--name-only"]) stdout, _, _ = self._run_git_command(["diff", "--cached", "--name-only"])
return stdout.splitlines() if stdout else [] return stdout.splitlines() if stdout else []
def get_unstaged_files(self) -> List[str]: def get_unstaged_files(self) -> List[str]:
"""Get list of unstaged files.""" """Get list of unstaged files."""
stdout, _ = self._run_git_command( stdout, _, _ = self._run_git_command(
["ls-files", "--modified", "--others", "--exclude-standard"] ["ls-files", "--modified", "--others", "--exclude-standard"]
) )
return stdout.splitlines() if stdout else [] return stdout.splitlines() if stdout else []
@@ -62,7 +62,7 @@ class GitService:
args = ["diff", "--cached" if staged else ""] args = ["diff", "--cached" if staged else ""]
if file_path: if file_path:
args.append(file_path) args.append(file_path)
stdout, _ = self._run_git_command(args) stdout, _, _ = self._run_git_command(args)
return stdout return stdout
def get_all_diffs(self, staged: bool = True) -> Dict[str, str]: def get_all_diffs(self, staged: bool = True) -> Dict[str, str]:
@@ -76,17 +76,17 @@ class GitService:
if sign: if sign:
args.append("-S") args.append("-S")
args.extend(["-m", message]) args.extend(["-m", message])
stdout, stderr = self._run_git_command(args) stdout, stderr, _ = self._run_git_command(args)
return not stderr return not stderr
def get_repo_name(self) -> str: def get_repo_name(self) -> str:
"""Get the repository name.""" """Get the repository name."""
stdout, _ = self._run_git_command(["rev-parse", "--show-toplevel"]) stdout, _, _ = self._run_git_command(["rev-parse", "--show-toplevel"])
return Path(stdout).name return Path(stdout).name
def get_current_branch(self) -> str: def get_current_branch(self) -> str:
"""Get the current branch name.""" """Get the current branch name."""
stdout, _ = self._run_git_command(["rev-parse", "--abbrev-ref", "HEAD"]) stdout, _, _ = self._run_git_command(["rev-parse", "--abbrev-ref", "HEAD"])
return stdout return stdout
def push(self, branch: Optional[str] = None) -> bool: def push(self, branch: Optional[str] = None) -> bool:
@@ -166,7 +166,7 @@ class GitService:
if limit: if limit:
args.append(f"-n {limit}") args.append(f"-n {limit}")
stdout, _ = self._run_git_command(args) stdout, _, _ = self._run_git_command(args)
commits = [] commits = []
current_commit = [] current_commit = []