Skip to content

Commit

Permalink
remove asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
tjwald committed Jan 23, 2025
1 parent e93a106 commit 18380b6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions checkov/secrets/scan_git_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,7 @@ def _get_commits_diff(self, last_commit_sha: Optional[str] = None) -> List[Commi
)
)
for file_diff in git_diff:
file_name = file_diff.a_path if file_diff.a_path else file_diff.b_path
assert file_name is not None
file_name: str = file_diff.a_path if file_diff.a_path else file_diff.b_path # type:ignore
if file_name.endswith(FILES_TO_IGNORE_IN_GIT_HISTORY):
continue
file_path = os.path.join(self.root_folder, file_name)
Expand Down Expand Up @@ -241,8 +240,7 @@ def _get_first_commit(self) -> Commit:
)

for file_diff in git_diff:
file_name = file_diff.b_path
assert file_name is not None
file_name: str = file_diff.b_path # type:ignore
if file_name.endswith(FILES_TO_IGNORE_IN_GIT_HISTORY):
continue
file_path = os.path.join(self.root_folder, file_name)
Expand Down

0 comments on commit 18380b6

Please sign in to comment.