allenai / allenai/tango

Fix ValueError raised by local git repository

Ouverte
#584 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
bug
Langage dominant
Python
Étoiles
572
Forks
55
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

### 🐛 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.
```python
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
```

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.