import org.eclipse.jgit.transport.FetchResult;
public class FetchRemoteCommitsWithPrune {
private static final String REMOTE_URL = "https://github.com/github/testrepo.git";
public static void main(String[] args) throws IOException, GitAPIException {
File localPath = File.createTempFile("TestGitRepository", "");
<BUG>localPath.delete();

System.out.println("Cloning from " + REMOTE_URL + " to " + localPath);</BUG>
try (Git git = Git.cloneRepository()
.setURI(REMOTE_URL)

import org.eclipse.jgit.transport.FetchResult;
public class FetchRemoteCommitsWithPrune {
private static final String REMOTE_URL = "https://github.com/github/testrepo.git";
public static void main(String[] args) throws IOException, GitAPIException {
File localPath = File.createTempFile("TestGitRepository", "");
if(!localPath.delete()) {
throw new IOException("Could not delete temporary file " + localPath);
}
System.out.println("Cloning from " + REMOTE_URL + " to " + localPath);
try (Git git = Git.cloneRepository()
.setURI(REMOTE_URL)
