diff options
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/storage/file/RefDirectory.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/RefDirectory.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/RefDirectory.java index 0590f905ec..3917ff4716 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/RefDirectory.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/RefDirectory.java @@ -385,10 +385,17 @@ public class RefDirectory extends RefDatabase { if (entries == null) // not a directory or an I/O error return false; if (0 < entries.length) { + for (int i = 0; i < entries.length; ++i) { + String e = entries[i]; + File f = new File(dir, e); + if (f.isDirectory()) + entries[i] += '/'; + } Arrays.sort(entries); for (String name : entries) { - File e = new File(dir, name); - if (!scanTree(prefix + name + '/', e)) + if (name.charAt(name.length() - 1) == '/') + scanTree(prefix + name, new File(dir, name)); + else scanOne(prefix + name); } } |