Commit fedc05c8 by Carlos Martín Nieto

revwalk: don't show commits that become uninteresting after being enqueued

When we read from the list which `limit_list()` gives us, we need to check that
the commit is still interesting, as it might have become uninteresting after it
was added to the list.
parent 3cc5ec94
......@@ -246,10 +246,13 @@ static int revwalk_next_unsorted(git_commit_list_node **object_out, git_revwalk
{
git_commit_list_node *next;
if ((next = git_commit_list_pop(&walk->iterator_rand)) != NULL) {
while ((next = git_commit_list_pop(&walk->iterator_rand)) != NULL) {
/* Some commits might become uninteresting after being added to the list */
if (!next->uninteresting) {
*object_out = next;
return 0;
}
}
giterr_clear();
return GIT_ITEROVER;
......@@ -257,13 +260,15 @@ static int revwalk_next_unsorted(git_commit_list_node **object_out, git_revwalk
static int revwalk_next_toposort(git_commit_list_node **object_out, git_revwalk *walk)
{
git_commit_list_node *node;
git_commit_list_node *next;
node = git_commit_list_pop(&walk->iterator_topo);
if (node) {
*object_out = node;
while ((next = git_commit_list_pop(&walk->iterator_topo)) != NULL) {
/* Some commits might become uninteresting after being added to the list */
if (!next->uninteresting) {
*object_out = next;
return 0;
}
}
giterr_clear();
return GIT_ITEROVER;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment