Open
Description
Reproduction steps
Run the following code with workingDirectoryPath
set to a write-protected directory path and gitDirectoryPath
set to a writable directory path:
Lib2GitSharp.Repository.Init(workingDirectoryPath: "/", gitDirectoryPath: "/some/dir/.git")
Expected behavior
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'score.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
Metadata
Metadata
Assignees
Labels
No labels