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

Fix ValueError raised by local git repository #584

Open
SimLif opened this issue Jun 29, 2023 · 0 comments
Open

Fix ValueError raised by local git repository #584

SimLif opened this issue Jun 29, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@SimLif
Copy link

SimLif commented Jun 29, 2023

🐛 Describe the bug

When I initialize a local git repository, executing the code will raise ValueError: Remote named 'origin' didn't exist. I checked the code and found the bug is triggered by the code return cls(commit=str(repo.commit()), remote=repo.remote().url) in file "site-packages/tango/step_info.py", line 80.

I modified the code as below and fixed the bug.

try:
    remote = repo.remote().url
except:
    remote = 'local'

return cls(commit=str(repo.commit()), remote=remote)

Versions

Python 3.9.16
ai2-tango==1.2.1
gitdb==4.0.10
GitPython==3.1.31
@SimLif SimLif added the bug Something isn't working label Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant