libgit2 / libgit2/libgit2sharp
Worktrees.Add throws an exception if a slash is in the branch name
Nessuno ha ancora preso questa issue.
- Lingua principale
- C#
- Stelle
- 3.5k
- Fork
- 925
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Iniziare dal punto di ingresso Worktrees.Add e riprodurre l’errore con il branch feature/branch-name descritto nell’issue su Windows. Tracciare la creazione della directory del worktree e verificare che l’aggiunta di un branch contenente una barra completi l’operazione senza l’eccezione segnalata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- csharp, git
- Ambito
- devtools, tooling
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 40/100