import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.errors.GitAPIException;
public class CreateNewRepository {
public static void main(String[] args) throws IOException, IllegalStateException, GitAPIException {
File localPath = File.createTempFile("TestGitRepository", "");
<BUG>localPath.delete();

try (Git git = Git.init().setDirectory(localPath).call()) {</BUG>
System.out.println("Having repository: " + git.getRepository().getDirectory());
}

import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.errors.GitAPIException;
public class CreateNewRepository {
public static void main(String[] args) throws IOException, IllegalStateException, GitAPIException {
File localPath = File.createTempFile("TestGitRepository", "");
if(!localPath.delete()) {
throw new IOException("Could not delete temporary file " + localPath);
}
try (Git git = Git.init().setDirectory(localPath).call()) {
System.out.println("Having repository: " + git.getRepository().getDirectory());
}
