libgit2 / libgit2/libgit2sharp

Worktrees.Add throws an exception if a slash is in the branch name

Abierto
#1,961 1 comentario 0 reacciones 0 asignados Ver en GitHub

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

have a repository with the branches

  • main [default]
  • feature/branch-name

Clone the repository and add the worktree.

SourceCode:

               var cloneOptions = new CloneOptions()
                {
                    CredentialsProvider = (_url, _user, _cred) => this.Credentials,                    
                    Checkout = true,
                    RecurseSubmodules = true,
                };
                 
                this.gitRepositoryPath = Repository.Clone(this.SourceUrl, this.WorkdirPath, cloneOptions);
                
                using (var repo = new Repository(this.gitRepositoryPath))
                {
                    var path = Path.Combine(this.WorkdirPath, "..", this.Branch);

                    repo.Worktrees.Add(this.Branch, path, false);
                }   

Expected behavior

Worktree should be created

Actual behavior

Exception is thrown:
failed to make directory 'xxx/.git/worktrees/feature/branch-name': The system cannot find the path specified.

Version of LibGit2Sharp (release number or SHA1)

0,26, 0.27.0-preview-0182

Operating system(s) tested; .NET runtime tested

Windows 10, Windows Server 2016, .Net Framework 4.8

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comience en el punto de entrada Worktrees.Add y reproduzca el fallo con la rama feature/branch-name descrita en el issue en Windows. Siga la creación del directorio del worktree y verifique que añadir una rama que contenga una barra diagonal se complete sin la excepción indicada.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
csharp, git
Área
devtools, tooling
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
40/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.