Skip to content

Commit de5eb22

Browse files
jsbattigclaude
andcommitted
fix: Add missing _get_current_branch mock in temporal indexer test
The test was failing because it mocked _get_commit_history but not _get_current_branch, which is also called during index_commits() and runs git subprocess on the mock directory. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 9e74fa8 commit de5eb22

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

tests/unit/services/temporal/test_temporal_indexer_uses_parallel.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,16 @@ def test_index_commits_calls_parallel_processing(self):
7474
# Returns: (commits_processed, files_processed, vectors_created)
7575
indexer._process_commits_parallel = Mock(return_value=(10, 15, 20))
7676

77-
# Mock commit history
78-
with patch.object(indexer, "_get_commit_history") as mock_history:
77+
# Mock commit history and _get_current_branch (to avoid git subprocess calls)
78+
with (
79+
patch.object(indexer, "_get_commit_history") as mock_history,
80+
patch.object(indexer, "_get_current_branch") as mock_branch,
81+
):
7982
mock_history.return_value = [
8083
Mock(hash="commit1", timestamp=1000, message="Test commit 1"),
8184
Mock(hash="commit2", timestamp=2000, message="Test commit 2"),
8285
]
86+
mock_branch.return_value = "main"
8387

8488
# Call index_commits
8589
indexer.index_commits(all_branches=False)

0 commit comments

Comments
 (0)