From 92d0d5b89150cba27284f90b39a96e70227e6c43 Mon Sep 17 00:00:00 2001 From: Fusion Date: Tue, 19 May 2026 13:19:36 +0200 Subject: [PATCH] fix: don't combine --all with branch name in git log Using 'git log --all ' 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. --- apps/api/src/utils/git_history.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/api/src/utils/git_history.py b/apps/api/src/utils/git_history.py index 8dae1dd..7f18dcd 100644 --- a/apps/api/src/utils/git_history.py +++ b/apps/api/src/utils/git_history.py @@ -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 log_args = [ "log", - "--all", "--format=%H%x00%P%x00%an%x00%ae%x00%at%x00%s", f"--max-count={limit}", f"--skip={offset}", ] if branch: log_args.append(branch) + else: + log_args.append("--all") log_output = _run_git_command(repo_path, log_args)