Skip to content

Commit 848ccb4

Browse files
Update src/mcpm/utils/git.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 04c0ad0 commit 848ccb4

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/mcpm/utils/git.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,11 @@ def check_status(repo_path: Path, branch: Optional[str] = None, remote: str = "o
144144
# Get commit summaries if behind
145145
if status.commits_behind > 0:
146146
try:
147+
# Limit to the first N commits to avoid excessive overhead on very behind repos
147148
result = _run_git(
148-
repo_path, ["log", "--oneline", f"HEAD..{remote}/{branch}", "--reverse"], timeout=5
149+
repo_path,
150+
["log", "--oneline", "--max-count=50", f"HEAD..{remote}/{branch}", "--reverse"],
151+
timeout=5,
149152
)
150153
if result.returncode == 0:
151154
status.commit_summaries = [line for line in result.stdout.strip().split("\n") if line]

0 commit comments

Comments
 (0)