Skip to content

Commit

Permalink
pass cached=True to Repository.diff(). This is quicker than running i…
Browse files Browse the repository at this point in the history
…t against the full working directory (#351)
  • Loading branch information
hong-godaddy authored Apr 25, 2022
1 parent ed5f89b commit 3f075ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tartufo/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ def load_repo(self, repo_path: str) -> pygit2.Repository:
@property
def chunks(self):
"""Yield the individual file changes currently staged for commit."""
diff_index = self._repo.diff("HEAD")
diff_index = self._repo.diff("HEAD", cached=True)
for blob, file_path in self._iter_diff_index(diff_index):
yield types.Chunk(blob, file_path, {})

Expand Down

0 comments on commit 3f075ab

Please sign in to comment.