fix: treeNotSorted issue · Pull Request #1799 · gitpython-developers/GitPython (original) (raw)
Thanks a lot for providing a fix!
I wonder if there was a way to assure the ordering is correct by looking at what git would do.
I assume the files_in_desired_order
is from a repository, could you show a git cat-file <tree>
? Alternatively, maybe there is a way to use git
to build a (somewhat) similar tree, and have the test compare the outcome of GitPython with the outcome of git itself - it's much more effort though.
Finally, here is a good tree for testing ordering, and you might be able create a test-case with this one as well.
Something I'd appreciate is to re-order the commits so that the test, whatever you come up with, first, and the fix later so it's clear how it fails first.
Thanks a lot for bearing with me, but I'd like to gain confidence that this is now indeed what git would do, and not just different but subtly wrong (I have been bitten by this more than once).