I am programmatically trying to clone a repo using the JGit API. I am using the following piece of code, but when I execute it, I am getting an error.
I have tried all possible solutions which I could find but still I am unable to resolve the problem. Can anyone provide inputs?
File localPath = File.createTempFile("TestGitRepository", "");
Git result = Git.cloneRepository()
.setURI("https://gitlab.wuintranet.net/fe/wu-content.git")
.setDirectory(localPath)
.call();
The repo at "https://gitlab.wuintranet.net/fe/wu-content.git" should get cloned but it is throwing this error:
java.nio.file.AccessDeniedException: C:\Program Files\Git\mingw64\etc.probe-e65aa729-82b1-4ff9-8d9b-3a4a7ea3de4a
I got the same problem under windows during gradle tests. Running the console to from which i start the test in admin mode worked for me. On other operating systems running it with sudo might work.