Open TureyLab opened 2 years ago
have a repository with the branches
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); }
Worktree should be created
Exception is thrown: failed to make directory 'xxx/.git/worktrees/feature/branch-name': The system cannot find the path specified.
0,26, 0.27.0-preview-0182
Windows 10, Windows Server 2016, .Net Framework 4.8
I have this same issue :(
Reproduction steps
have a repository with the branches
Clone the repository and add the worktree.
SourceCode:
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