summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.http.test
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2011-04-21 12:40:26 -0700
committerShawn O. Pearce <spearce@spearce.org>2011-04-21 12:40:26 -0700
commit33e65ec6911795cf2816af1f64b5699dd898d59f (patch)
tree63dc9c9d494f5d838eb74c0ee020563c04f23b0c /org.eclipse.jgit.http.test
parent502508f0286e07100e214fed5506ee20be5673dc (diff)
downloadjgit-33e65ec6911795cf2816af1f64b5699dd898d59f.tar.gz
jgit-33e65ec6911795cf2816af1f64b5699dd898d59f.zip
Fix sorting of names in RefDirectory
RefDirectory did not correctly follow the contract of RefList. The contract says if you use add() method of RefList builder, you MUST sort() it afterwards, and later every other method assumes that list is properly sorted (especially the binary search in the find() and get() methods). Instead RefDirectory class tried to scan the refs recursively while sorting every folder in the process before processing and did not call sort(). For example, when scanning the contents of refs/tags project1 string is smaller than project1-*, so it will recursively go into the folder and add these tags first and only then will add project-* ones. This will result in a broken list (any project1-* string is less than project1/* one, but they all appear after them in the list), that's why binary search will fail making loose RefList and the whole local RefMap completely unusable. Change-Id: Ibad90017e3b2435b1396b69a22520db4b1b022bb Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit.http.test')
0 files changed, 0 insertions, 0 deletions