summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileRepository.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileRepository.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileRepository.java
index a2daef30d8..c8d3ffcd8f 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileRepository.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileRepository.java
@@ -21,6 +21,7 @@ import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
+import java.nio.file.Files;
import java.text.MessageFormat;
import java.text.ParseException;
import java.util.ArrayList;
@@ -727,7 +728,8 @@ public class FileRepository extends Repository {
throws IOException {
File reftableDir = new File(getDirectory(), Constants.REFTABLE);
File headFile = new File(getDirectory(), Constants.HEAD);
- if (reftableDir.exists() && reftableDir.listFiles().length > 0) {
+ if (reftableDir.exists()
+ && Files.list(reftableDir.toPath()).findAny().isPresent()) {
throw new IOException(JGitText.get().reftableDirExists);
}