ValueError `repo.branches.get('branch_no_exist/')` trailing slashes in branch names
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 1.7k
- Fork
- 408
- Merge medio
- 2g 57m
- PR unite (30g)
- 7
Descrizione
if i have a repo and call
>> 'branch_no_exist' in repo.branches
False
as expected, but
>> 'branch_no_exist/' in repo.branches
Traceback (most recent call last):
pygit2/repository.py", line 1156, in get
return self[key]
pygit2/repository.py", line 1144, in __getitem__
branch = self._repository.lookup_branch(name, GIT_BRANCH_LOCAL)
ValueError: cannot locate local branch 'branch_no_exist/'
Given branch names Shouldn't end in a slash, but the error is not complaining about this.
should repository.lookup_branch be returning None in this case?
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia in pygit2/repository.py, nel metodo get e nel percorso getitem mostrato nel traceback, quindi riproduci le ricerche di un branch inesistente con e senza una barra finale. Controlla i test esistenti per la ricerca dei branch e definisci il completamento come una gestione coerente del caso con barra finale, coperta da un test di regressione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- git, python
- Ambito
- tooling
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 38/100