Commit 2e3a0055 by Carlos Martín Nieto

revwalk: return GIT_EREVWALKER earlier if no references were pushed

In the case that walk->one is NULL, we know that we have no positive
references, so we already know that the revwalk is over.
parent bf4ef0c5
...@@ -689,6 +689,13 @@ static int prepare_walk(git_revwalk *walk) ...@@ -689,6 +689,13 @@ static int prepare_walk(git_revwalk *walk)
commit_object *next, *two; commit_object *next, *two;
commit_list *bases = NULL; commit_list *bases = NULL;
/*
* If walk->one is NULL, there were no positive references,
* so we know that the walk is already over.
*/
if (walk->one == NULL)
return GIT_EREVWALKOVER;
/* first figure out what the merge bases are */ /* first figure out what the merge bases are */
if (merge_bases_many(&bases, walk, walk->one, &walk->twos) < 0) if (merge_bases_many(&bases, walk, walk->one, &walk->twos) < 0)
return -1; return -1;
......
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