libgit2 / libgit2/pygit2

"this operation is only valid for push"

Aperta
#1,188 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

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

Descrizione

The sequence of calls

remote.ls_remotes(...)
remote.fetch(...)
remote.push(...)

works, while

remote.ls_remotes(...)
remote.push(...)

doesn't, producing the GIT_ERROR_NET / "this operation is only valid for push" error.

I think this is because ls_remotes() explicitly calls connect(..., GIT_DIRECTION_FETCH), and fetch() implicitly calls disconnect() (within git_remote_fetch()). If fetch() is not called between ls_remotes() and push(), git_remote_push() encounters an existing connection with FETCH direction, and returns an error (from git_smart__get_push_stream()).

This could be addressed in several ways: either by disconnecting explicitly in ls_remotes(), or maybe by changing the implementation of connect_or_reset_options() and the functions it calls to handle the case where direction is changing.

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 riproducendo le due sequenze di chiamate con remote.ls_remotes(), remote.fetch() e remote.push(), quindi esamina connect_or_reset_options() e il percorso di git_remote_push() descritto nell’issue. Il lavoro è completato quando il push diretto dopo ls_remotes() riesce senza l’errore GIT_ERROR_NET, con una copertura di regressione per quella sequenza.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
git, python
Ambito
backend, networking
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.