fix: don't combine --all with branch name in git log

Using 'git log --all <branch>' creates ambiguous behavior. Now:
- Without branch: uses --all to show all commits from all refs
- With branch: shows only commits from that specific branch

This ensures consistent commit counts between git CLI and API.
This commit is contained in:
Fusion
2026-05-19 13:19:36 +02:00
parent 834982d423
commit 92d0d5b891
+2 -1
View File
@@ -67,13 +67,14 @@ def get_commit_history(repo_path: str, branch: str | None = None, limit: int = 1
# Build git log command - use NULL bytes as separators to avoid parsing issues # Build git log command - use NULL bytes as separators to avoid parsing issues
log_args = [ log_args = [
"log", "log",
"--all",
"--format=%H%x00%P%x00%an%x00%ae%x00%at%x00%s", "--format=%H%x00%P%x00%an%x00%ae%x00%at%x00%s",
f"--max-count={limit}", f"--max-count={limit}",
f"--skip={offset}", f"--skip={offset}",
] ]
if branch: if branch:
log_args.append(branch) log_args.append(branch)
else:
log_args.append("--all")
log_output = _run_git_command(repo_path, log_args) log_output = _run_git_command(repo_path, log_args)