Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <carlos@cmartin.tk>2012-04-16 13:58:46 +0400
committerCarlos Martín Nieto <carlos@cmartin.tk>2012-04-25 14:45:03 +0400
commit2e3a0055d136d13fba365bf2a26638f84bd32d02 (patch)
tree0375d907fc75bf06ed377576b047e2536dc4288e /src/revwalk.c
parentbf4ef0c567c3add37aa1744467692c49a534d264 (diff)
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.
Diffstat (limited to 'src/revwalk.c')
-rw-r--r--src/revwalk.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/revwalk.c b/src/revwalk.c
index a62576038..041dc1a1c 100644
--- a/src/revwalk.c
+++ b/src/revwalk.c
@@ -689,6 +689,13 @@ static int prepare_walk(git_revwalk *walk)
commit_object *next, *two;
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 */
if (merge_bases_many(&bases, walk, walk->one, &walk->twos) < 0)
return -1;