summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-07-03 15:12:14 -0700
committerVicent Marti <tanoku@gmail.com>2013-07-10 20:50:32 +0200
commit733c4f3aca212d90459fb21cfbc137f09ff6c951 (patch)
tree2a86a0633223f77b12deb5dfffa9f1b80336f2c0
parent5a169711fa9875bc98c30c49b5e9ea06ebbbcfeb (diff)
downloadlibgit2-733c4f3aca212d90459fb21cfbc137f09ff6c951.tar.gz
more examples/log.c bug fixing
-rw-r--r--examples/log.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/log.c b/examples/log.c
index f7aabf0b4..ba411d7a4 100644
--- a/examples/log.c
+++ b/examples/log.c
@@ -94,11 +94,11 @@ static int add_revision(struct log_state *s, const char *revstr)
if (*revstr == '^') {
revs.flags = GIT_REVPARSE_SINGLE;
hide = !hide;
- if (!git_revparse_single(&revs.from, s->repo, revstr + 1))
- return -1;
- } else
- if (!git_revparse(&revs, s->repo, revstr))
+
+ if (git_revparse_single(&revs.from, s->repo, revstr + 1) < 0)
return -1;
+ } else if (git_revparse(&revs, s->repo, revstr) < 0)
+ return -1;
if ((revs.flags & GIT_REVPARSE_SINGLE) != 0)
push_rev(s, revs.from, hide);