Patch Set 3: Looks good to me, but someone else must approve; Unclean IP, do not check in

I can't reproduce the bug anymore using the proper JGit build within Gerrit Code Review.  Also, since the unit test passes, and is nearly full code coverage, I'd say its pretty likely to be correct at this point.