I\'m trying to get my hands on the HEAD commit with JGit:
val builder = new FileRepositoryBuilder() val repo = builder.setGitDir(new File(\"/www/test-repo\")
You can also use val git: Git = Git.open( new File( "/www/test-repo" ) ). JGit will then scan the given folder for the git meta directory (usually .git). If it fails to find this folder, an IOException will be thrown.
val git: Git = Git.open( new File( "/www/test-repo" ) )
.git
IOException