Commit 733c4f3aca212d90459fb21cfbc137f09ff6c951

Russell Belfer 2013-07-03T15:12:14

more examples/log.c bug fixing

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/examples/log.c b/examples/log.c
index f7aabf0..ba411d7 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);