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

conftest pull git repository fails if folder already exists #1022

Open
elisiariocouto opened this issue Nov 27, 2024 · 1 comment
Open

conftest pull git repository fails if folder already exists #1022

elisiariocouto opened this issue Nov 27, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@elisiariocouto
Copy link

Hello everyone. We are using conftest to automate some OPA checks.

We have a repository with our OPA policies and we run conftest pull git::<my repo> before executing conftest test and it fails if the default folder policy already exists.

You can easily reproduce this by running conftest pull git::<your repo> twice, the first time it pulls the policies, the second time it fails with a git error (which is hiding the real issue):

Error: download policies: client get: error downloading 'ssh://git@<myrepo>': /opt/homebrew/bin/git exited with 128: fatal: empty string is not a valid pathspec. please use . instead if you meant to match all paths

Is this intended?

Thank you

@elisiariocouto elisiariocouto changed the title conftest pull git repository fails if folder alreaedy exists conftest pull git repository fails if folder already exists Dec 2, 2024
@jalseth jalseth added the enhancement New feature or request label Dec 7, 2024
@jalseth
Copy link
Member

jalseth commented Dec 7, 2024

Marking this as an enhancement for now as there is a straightforward work-around available by deleting the folder first.

This would be a good candidate for an action that prompts the user by default, but the confirmation can be skipped with a flag so it works reliably in scripts etc.

PRs are welcomed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants