summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2015-04-08 23:51:49 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2015-04-08 23:51:49 +0200
commit50fdfe2bcbabc0a9d77966d9d18d035b61e950d3 (patch)
treef5d8bb22ff4e62a71f88769087ceb9eb6ad31f4d
parent5a503fffbc01037c8e6e6bb2f755f7d62d09faf6 (diff)
downloadlibgit2-50fdfe2bcbabc0a9d77966d9d18d035b61e950d3.tar.gz
revwalk: don't insert uninteresting commits into the queue
When a commit is first set as unintersting and then pushed, we must take care that we do not put it into the commit list as that makes us return at least that commit (but maybe more) as we've inserted it into the list because we have the assumption that we want anything in the commit list.
-rw-r--r--src/revwalk.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/revwalk.c b/src/revwalk.c
index a6d823ec8..9d0fafddf 100644
--- a/src/revwalk.c
+++ b/src/revwalk.c
@@ -144,6 +144,10 @@ static int push_commit(git_revwalk *walk, const git_oid *oid, int uninteresting,
if (commit == NULL)
return -1; /* error already reported by failed lookup */
+ /* A previous hide already told us we don't want this commit */
+ if (commit->uninteresting)
+ return 0;
+
if (uninteresting)
walk->did_hide = 1;
else