Commit 5a169711fa9875bc98c30c49b5e9ea06ebbbcfeb

Russell Belfer 2013-07-03T15:08:54

fix bug with order args and no revision

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
diff --git a/examples/log.c b/examples/log.c
index 61b7892..f7aabf0 100644
--- a/examples/log.c
+++ b/examples/log.c
@@ -86,9 +86,12 @@ static int add_revision(struct log_state *s, const char *revstr)
 			"Could not open repository", s->repodir);
 	}
 
-	if (!revstr)
+	if (!revstr) {
 		push_rev(s, NULL, hide);
-	else if (*revstr == '^') {
+		return 0;
+	}
+
+	if (*revstr == '^') {
 		revs.flags = GIT_REVPARSE_SINGLE;
 		hide = !hide;
 		if (!git_revparse_single(&revs.from, s->repo, revstr + 1))