libgit2 / libgit2/pygit2

branch upstream_name InvalidRefSpec error on literal remote values for branch

Aperta
#865 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

libgit2
Lingua principale
Python
Stelle
1.7k
Fork
408
Merge medio
2g 57m
PR unite (30g)
7

Descrizione

when using hub (https://hub.github.com) to checkout pull requests, it generates a config entry for the branch with the direct reference to the remote git url instead of adding in a remote. This seems to cause some confusion for pygit, specifically iy will end up throwing an InvalidSpecError as pygit tries to follow the remote as a name instead of being to handle a literal git repo value. I'd suggest in such a case pygit simply return the remote name.

https://github.com/libgit2/pygit2/blob/master/src/branch.c#L245

$ branch
<_pygit2.Branch object at 0x10d1197b0>
$ branch.upstream_name
*** _pygit2.InvalidSpecError: 'https://github.com/steveparker-1984/cloud-custodian.git' is not a valid remote name.

entry in .git/config

[branch "fail-on-assume-role-error"]
        remote = https://github.com/steveparker-1984/cloud-custodian.git
        merge = refs/heads/fail-on-assume-role-error

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia ispezionando src/branch.c intorno alla riga 245 e riproduci la configurazione mostrata con un valore HTTPS letterale in branch.remote. Traccia la gestione di branch.upstream_name per quel valore; è completato quando non solleva più InvalidSpecError e segue il comportamento richiesto per il nome del remote.

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
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.