Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move head and base normalization to source #818

Merged
merged 1 commit into from
Sep 23, 2022
Merged

Conversation

bill-rich
Copy link
Collaborator

Prevents a bad head or base being used in git source.

@bill-rich bill-rich requested review from a team as code owners September 22, 2022 23:48
@@ -453,6 +458,55 @@ func (s *Git) ScanRepo(ctx context.Context, repo *git.Repository, repoPath strin
return nil
}

func normalizeConfig(scanOptions *ScanOptions, repo *git.Repository) (err error) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion (optional): We may be able to minimize our if statements by starting the function with something like:

if scanOptions.BaseHash == "" || scanOptions.HeadHash == "" {
    // Nothing to do.
    return nil
}

// ...

@bill-rich bill-rich merged commit e3107ad into main Sep 23, 2022
@bill-rich bill-rich deleted the move_head_base_normalize branch September 23, 2022 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants