Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

Feature: Expose CloneOptions when analyzing a git repo #167

Open
cjnosal opened this issue Mar 30, 2021 · 0 comments · May be fixed by #169
Open

Feature: Expose CloneOptions when analyzing a git repo #167

cjnosal opened this issue Mar 30, 2021 · 0 comments · May be fixed by #169

Comments

@cjnosal
Copy link

cjnosal commented Mar 30, 2021

remote.NewArtifact currently uses a hardcoded git.CloneOptions to clone the default branch and write progress to stdout (https://github.com/aquasecurity/fanal/blob/main/artifact/remote/git.go#L30-L34)

This prevents multiple scanning use cases:

  • scanning a branch before it's merged to main
  • scanning a private repo
  • suppressing/redirecting git's progress to stdout (e.g. when trying to parse the output of trivy repo --format json)

Adding a git.CloneOptions (or wrapping CloneOptions in a fanal type as image.NewArtifact does with DockerOptions) parameter to remote.NewArtifact would offer flexibility to fanal's consumers.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant