mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-08 22:08:56 +00:00
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.
This commit is contained in:
parent
3cc5ec94f8
commit
fedc05c89c
@ -246,9 +246,12 @@ static int revwalk_next_unsorted(git_commit_list_node **object_out, git_revwalk
|
|||||||
{
|
{
|
||||||
git_commit_list_node *next;
|
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) {
|
||||||
*object_out = next;
|
/* Some commits might become uninteresting after being added to the list */
|
||||||
return 0;
|
if (!next->uninteresting) {
|
||||||
|
*object_out = next;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
giterr_clear();
|
giterr_clear();
|
||||||
@ -257,12 +260,14 @@ 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)
|
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);
|
while ((next = git_commit_list_pop(&walk->iterator_topo)) != NULL) {
|
||||||
if (node) {
|
/* Some commits might become uninteresting after being added to the list */
|
||||||
*object_out = node;
|
if (!next->uninteresting) {
|
||||||
return 0;
|
*object_out = next;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
giterr_clear();
|
giterr_clear();
|
||||||
|
Loading…
Reference in New Issue
Block a user