Pushing new branches does not set up tracking branch completely

Aperta
#514 9 commenti 4 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
38/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
csharp, git
Ambito
devtools

Direzione di ricerca

Inizia leggendo gli overload di Push e l’utilizzo di BranchUpdater mostrati nell’issue, quindi esamina i fixture di test di push esistenti, perché l’issue indica che nessuno copre questo comportamento. Il lavoro è completo quando il percorso di push supportato per un nuovo branch stabilisce la configurazione di branch.remote e branch.merge, con un test che specifichi il comportamento previsto.

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

Descrizione

Up for grabs

When you push a local branch that does not exist on the remote (using the refspec overload), libgit2sharp automatically creates a tracking branch, but it does not set up the config for the local branch

i.e. the following config entries are missing:

branch.(branch_name).remote
branch.(branch_name).merge

Currently, I push a new branch like as follows:

string refspec = string.Format("{0}:{1}",
    currentBranch.CanonicalName, currentBranch.CanonicalName);
repo.Network.Push(remote, refspec, handler, credentials);
repo.Branches.Update(repo.Head, delegate(BranchUpdater updater)
{
    updater.Remote = remote.Name;
    updater.UpstreamBranch = repo.Head.CanonicalName;
});

I feel like this should be simplified. Either by doing the BranchUpdater stuff in Push(), or by extending the Push(Branch, ...) overload to let it accept non-tracking branches and do the whole process.

I also did not find a test fixture covering that feature, so the intended behaviour should at least be specified.

Lingua principale
C#
Stelle
3.5k
Fork
925
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

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.

Altre issue di libgit2/libgit2sharp

Tutte le issue di libgit2/libgit2sharp

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.