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

Handle empty git repos #46

Merged
merged 3 commits into from
Jan 28, 2020
Merged

Handle empty git repos #46

merged 3 commits into from
Jan 28, 2020

Conversation

sp3nx0r
Copy link
Contributor

@sp3nx0r sp3nx0r commented Jan 27, 2020

Addresses Issue #19

Two changes:

  1. Add exception catching for _git() for two scenarios: A) initial add (fails on getting HEAD) and B) scan with empty commit hashes
  2. Add code to handle scanning an empty repo and update said repo if it does flip to non-empty in scan.py. This also required a change in _clone_and_save_repo() to allow an update to existing metadata.

Unintended side effect was having to change the test case for existing metadata. I flipped it to testing for allowing update because my mocking blows and I couldn't figure out how to easily add a repo.last_commit_hash so it wouldn't take the empty repo path.

Copy link
Collaborator

@KevinHock KevinHock left a comment

Choose a reason for hiding this comment

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

Looks really great to me, thank you for making this!

Asked for one clarification, but that's all.

detect_secrets_server/actions/scan.py Outdated Show resolved Hide resolved
@KevinHock KevinHock merged commit 5d6224e into Yelp:master Jan 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants