Skip to content

Commit

Permalink
fix: TEST unfix valid commit ref
Browse files Browse the repository at this point in the history
  • Loading branch information
carla-gitguardian committed Jan 8, 2024
1 parent 5b6e6b7 commit b05d44d
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions ggshield/core/git_hooks/ci/previous_commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,9 @@ def gitlab_previous_commit_sha(verbose: bool) -> Optional[str]:
# Targeted branch is empty
if merge_req_base_sha == EMPTY_SHA:
return None
if is_valid_git_commit_ref(merge_req_base_sha):
return merge_req_base_sha

if (
push_before_sha
and push_before_sha != EMPTY_SHA
and is_valid_git_commit_ref(push_before_sha)
):
return merge_req_base_sha

if push_before_sha and push_before_sha != EMPTY_SHA:
return push_before_sha

# push_before_sha is also always EMPTY_SHA for the first commit of a new branch
Expand Down

0 comments on commit b05d44d

Please sign in to comment.