libgit2 / libgit2/libgit2sharp
Setting tracking branch fails with "ref 'refs/remotes/origin/master' doesn't match the destination"
Abierto
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- C#
- Estrellas
- 3.5k
- Forks
- 925
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
Reproduction steps
- a repo with multiple overlapping fetch specs:
[remote "origin"]
url = ../multifetchspec_testrepo.git/
fetch = +refs/pull/28/head:refs/remotes/origin/PR-28
fetch = +refs/heads/master:refs/remotes/origin/master
fetch = +refs/heads/*:refs/remotes/origin/*
- repo doesn't have local
masterbranch (but remote does) - call
repo.Branches.Update("master", b => b.TrackedBranch = trackedBranch.CanonicalName);(withtrackedBranchpointing torefs/remotes/origin/master).
Expected behavior
Tracking branch gets set.
Actual behavior
Exception:
LibGit2Sharp.LibGit2SharpException: ref 'refs/remotes/origin/master' doesn't match the destination
LibGit2Sharp.LibGit2SharpException
ref 'refs/remotes/origin/master' doesn't match the destination
at LibGit2Sharp.Core.Ensure.HandleError(Int32 result) in D:\Develop\libgit2sharp\LibGit2Sharp\Core\Ensure.cs:line 154
at LibGit2Sharp.Core.Ensure.ZeroResult(Int32 result) in D:\Develop\libgit2sharp\LibGit2Sharp\Core\Ensure.cs:line 172
at LibGit2Sharp.Core.Proxy.git_refspec_rtransform(IntPtr refSpecPtr, String name) in D:\Develop\libgit2sharp\LibGit2Sharp\Core\Proxy.cs:line 2085
at LibGit2Sharp.Remote.FetchSpecTransformToSource(String reference) in D:\Develop\libgit2sharp\LibGit2Sharp\Remote.cs:line 138
at LibGit2Sharp.BranchUpdater.GetUpstreamInformation(String canonicalName, String& remoteName, String& mergeBranchName) in D:\Develop\libgit2sharp\LibGit2Sharp\BranchUpdater.cs:line 188
at LibGit2Sharp.BranchUpdater.SetUpstream(String upstreamBranchName) in D:\Develop\libgit2sharp\LibGit2Sharp\BranchUpdater.cs:line 116
at LibGit2Sharp.BranchUpdater.set_TrackedBranch(String value) in D:\Develop\libgit2sharp\LibGit2Sharp\BranchUpdater.cs:line 53
at LibGit2Sharp.Tests.BranchFixture.<>c__DisplayClass43_0.<CanSetTrackedBranch_MultipleFetchSpecs>b__0(BranchUpdater b) in D:\Develop\libgit2sharp\LibGit2Sharp.Tests\BranchFixture.cs:line 898
at LibGit2Sharp.BranchCollection.Update(Branch branch, Action`1[] actions) in D:\Develop\libgit2sharp\LibGit2Sharp\BranchCollection.cs:line 292
Version of LibGit2Sharp (release number or SHA1)
4de700fedf87a5c9de10b921a636cc2f21d8964d
Operating system(s) tested; .NET runtime tested
Windows 10, Ubuntu 18.04
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con la prueba fallida CanSetTrackedBranch_MultipleFetchSpecs en LibGit2Sharp.Tests/BranchFixture.cs. Sigue BranchUpdater.GetUpstreamInformation y Remote.FetchSpecTransformToSource usando las especificaciones de fetch superpuestas de la reproducción. El problema estará resuelto cuando establecer la rama rastreada tenga éxito y la prueba de regresión pase en los escenarios indicados.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- csharp, git
- Área
- devtools
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bien especificado
- Aptitud para principiantes
- 35/100