JGit clone call fails because it does not hold the lock [message #1800178] |
Thu, 20 December 2018 18:31  |
Eclipse User |
|
|
|
I have been using version 3.7.1.201504261725-r of JGit to clone repositories successfully. It was quite an old version, because it was used in an Android project that was updated to Java 8 only recently. I tried to update it to the latest version 5.2.0.201812061821-r, but since then, the clone commands seems to fail.
I get an java.nio.file.AccessDeniedException: /data/user/0/com.myapp/files/myrepository/.git/HEAD.lock.fe153d42e64044e8b98758a805538e76 -> /data/user/0/com.myapp/files/myrepository/.git/HEAD.lock
Stacktrace is
sun.nio.fs.UnixFileSystemProvide.createLink(UnixFileSystemProvider.java:480)
java.nio.file.Files.createLink(Files.java:1086)
org.eclipse.jgit.util.FS_POSIX.createNewFileAtomic(FS_POSIX.java:455)
org.eclipse.jgit.internal.storage.file.LockFile.lock(LockFile.java:164)
org.eclipse.jgit.internal.storage.file.RefDirectoryUpdate.tryLock(RefDirectoryUpdate.java:89)
org.eclipse.jgit.lib.RefUpdate.link(Refpdate.java:708)
org.eclipse.jgit.internal.storage.file.FileRepository.create(FileRepository.java:309)
org.eclipse.jgit.api.InitCommand.call(InitCommand.java:125)
org.eclipse.jgit.api.CloneCommand.init(CloneCommand.java:274)
org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:195)
There was no local repository prior to cloning. FileRepository::create() creates all the directories needed, then in RefUpdate::link() it fails to acquire the lock with "refs/heads/master" as the target.
This is the head FileRepository object with which we call RefUpdate::link()
Does the clone command work differently between the old version and now ?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05270 seconds