diff options
| author | Russell Belfer <rb@github.com> | 2013-07-03 15:12:14 -0700 |
|---|---|---|
| committer | Vicent Marti <tanoku@gmail.com> | 2013-07-10 20:50:32 +0200 |
| commit | 733c4f3aca212d90459fb21cfbc137f09ff6c951 (patch) | |
| tree | 2a86a0633223f77b12deb5dfffa9f1b80336f2c0 | |
| parent | 5a169711fa9875bc98c30c49b5e9ea06ebbbcfeb (diff) | |
| download | libgit2-733c4f3aca212d90459fb21cfbc137f09ff6c951.tar.gz | |
more examples/log.c bug fixing
| -rw-r--r-- | examples/log.c | 8 |
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); |
