Fix interaction between limited flag and sorting over resets#4688
Fix interaction between limited flag and sorting over resets#4688ethomson merged 1 commit intolibgit2:masterfrom
Conversation
This patch shouldn't be merged until libgit2 0.28 is released, as the mailmap support is not present outside of the master branch currently. This patch sets us up to test against the master branch for now. NOTE: A test fails until libgit2/libgit2#4688 is landed on libgit2 master.
|
Where we do we get the idea that the sorting should persist? That sort of worked many years ago but the |
|
Not sure. I was surprised that it persisted, but that appears to match the current behavior and the behavior tested by pygit2 in a test. It would be perfectly reasonable to change to not persisting as well. |
|
I agree with @carlosmn. The documentation of
So there really shouldn't be any difference between a newly allocated revwalk via |
Currently we fail to clear the sorting flag for revwalks when resetting. This caused a poor interaction with the limited flag during a recent patch. This patch clears the revwalk sorting flag and causes it to no longer persist over resets.
05b86f9 to
4fd81c5
Compare
|
Swapped the behaviour change over |
|
Thanks, @mystor! |
Sorted revwalks have their limited flag set because lazy revwalks, which are used when
limitedis not set since #4606, currently only handleGIT_SORT_NONE.Revwalks persist their sorting over calls to
git_revwalk_reset. However, thelimitedflag was unconditionally cleared duringgit_revwalk_reset, which would cause breakage.This patch sets the limited flag for non-
GIT_SORT_NONErevwalks in reset, and adds a test for the failing case.I ran into this bug while making a version of
pygit2with the mailmap changes from #4586, as pygit2 tests started failing.