Yeah, bleh. I think of this problem as a bug in the behavior of the index. Even on a case insensitive filesystem, tree to index comparisons should be done case sensitively and the whole "resort the index to match the filesystem" is not very desirable.

In the medium term, I'd like to modify the index code to always keep the index sorted case sensitively with an optional secondary vector that is sorted case insensitively (and an optional tertiary hash table for fast looked, although I'm not certain if that hash table would be case sensitive or insensitive).

In the short term, I'm not sure what to do. If you have any ideas, I'm open to helping out. I'm actually interested in fixing that index problem, so let me know if that seems like the best solution and I can try to deal with it sooner rather than later.