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

Add a check for InvalidGitRepositoryError in get_repo_id function #653

Open
slimreaper35 opened this issue Sep 16, 2024 · 0 comments
Open
Labels
my first issue Good for newcomers

Comments

@slimreaper35
Copy link
Member

https://github.com/containerbuildsystem/cachi2/blob/main/cachi2/core/scm.py#L37

Currently, we are not checking if a directory is initialized as a git repository. If it is not, repo = Repo(repo) will result in an ugly exception. We should handle it properly as we do when checking if the repo has set an origin remote.

To reproduce:

git clone [email protected]:cachito-testing/cachi2-pip-extra.git
cd cachi2-pip-extra
git switch no-metadata
rm -rf .git/
cachi2 fetch-deps --source . pip
@slimreaper35 slimreaper35 added the my first issue Good for newcomers label Sep 18, 2024
slimreaper35 added a commit to slimreaper35/cachi2 that referenced this issue Oct 17, 2024
slimreaper35 added a commit to slimreaper35/cachi2 that referenced this issue Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
my first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant