You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Init() call works exactly as this git command: git --git-dir /some/dir/.git --work-tree /:
it creates a .git repository directory at /some/dir/.git with its config's core.worktree set to /
it does not touch the --work-tree directory / in any way and thus does not need write permissions in this directory
Actual behavior
An Exception of type Lib2GitException is thrown: failed to initialize repository with template '.git': Permission denied
Version of LibGit2Sharp (release number or SHA1)
0.26.2 (NuGet)
Operating system(s) tested; .NET runtime tested
Linux 5.9.14-arch1-1 #1 SMP PREEMPT Sat, 12 Dec 2020 14:37:12 +0000 x86_64 GNU/Linux
Microsoft.NETCore.App 3.1.8
The text was updated successfully, but these errors were encountered:
vogeljo
changed the title
Repository.Init with custom working tree directory does not do what i expect
Repository.Init wants to write to workingDirectoryPath
Dec 21, 2020
Reproduction steps
Run the following code with
workingDirectoryPath
set to a write-protected directory path andgitDirectoryPath
set to a writable directory path:Expected behavior
The Init() call works exactly as this git command:
git --git-dir /some/dir/.git --work-tree /
:/some/dir/.git
with its config'score.worktree
set to/
--work-tree
directory/
in any way and thus does not need write permissions in this directoryActual behavior
An Exception of type Lib2GitException is thrown:
failed to initialize repository with template '.git': Permission denied
Version of LibGit2Sharp (release number or SHA1)
0.26.2 (NuGet)
Operating system(s) tested; .NET runtime tested
Linux 5.9.14-arch1-1 #1 SMP PREEMPT Sat, 12 Dec 2020 14:37:12 +0000 x86_64 GNU/Linux
Microsoft.NETCore.App 3.1.8
The text was updated successfully, but these errors were encountered: