Skip to content

Commit

Permalink
improve temporary directory creation
Browse files Browse the repository at this point in the history
  • Loading branch information
JLLeitschuh authored Oct 4, 2022
1 parent 7ba4b9b commit bb811c5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.util.Arrays;

/**
Expand Down Expand Up @@ -90,9 +91,7 @@ public void testCommandRemoveWithTwoDirectory()
private File createTempDirectory()
throws IOException
{
File dir = File.createTempFile( "gitexe", "test" );
dir.delete();
dir.mkdir();
File dir = Files.createTempDirectory("gitexe" + "test").toFile();
return dir;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.io.InputStreamReader;
import java.net.URI;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.List;

import org.apache.commons.io.FileUtils;
Expand Down Expand Up @@ -577,9 +578,7 @@ private void testScmFile( ScmFile fileToTest, String expectedFilePath, ScmFileSt
private File createTempDirectory()
throws IOException
{
File dir = File.createTempFile( "gitexe", "test" );
dir.delete();
dir.mkdir();
File dir = Files.createTempDirectory("gitexe" + "test").toFile();
return dir;
}

Expand Down

0 comments on commit bb811c5

Please sign in to comment.