I am playing around with cloning a remote existing repo with jGit following the guide here:
I'm using CFML for my example:
Git = createObject( 'java', 'org.eclipse.jgit.api.Git' );
localPath = createObject( 'java', 'java.io.File' ).init( expandPath( 'temp' ) );
result = Git.cloneRepository()
.setURI( 'https://github.com/github/testrepo.git' )
.setDirectory( localPath )
.call();
result.close();
The clone works great, but file locks are not released on "pack" files inside temp\.git\objects\pack
until I stop the Java process.
Then I also noticed the API docs seem a little wishy-washy concerning the behavior of the result's .close()
method.:
http://download.eclipse.org/jgit/site/4.0.1.201506240215-r/apidocs/org/eclipse/jgit/lib/Repository.html#close()
Decrement the use count, and maybe close resources.
Maybe? What's that supposed to mean? What do I need to do in order to "relinquishing any underlying resources" as specified in the AutoCloseable
interface that the .close()
method helps implement?
There are a couple of similar questions on SO, but none of them involve using the static method on org.eclipse.jgit.api.Git
to clone a new repo.