diff options
author | Robin Rosenberg <robin.rosenberg@dewire.com> | 2011-08-10 14:40:25 -0400 |
---|---|---|
committer | Code Review <codereview-daemon@eclipse.org> | 2011-08-10 14:40:25 -0400 |
commit | 5a3a2b53eec76e914bf54848dc88a55ac7e347f7 (patch) | |
tree | cd75fd98a6e8174a279a450d00cb0e686165c54e /org.eclipse.jgit | |
parent | d4db26bb57b0a8027764679e06a99d3f4bfe628e (diff) | |
parent | c536873c87db0d87292a90a905b30301c110ceb3 (diff) | |
download | jgit-5a3a2b53eec76e914bf54848dc88a55ac7e347f7.tar.gz jgit-5a3a2b53eec76e914bf54848dc88a55ac7e347f7.zip |
Merge "Fix reading of ref names containing characters that sort before /"
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); } } |