summaryrefslogtreecommitdiff
path: root/examples/log.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-07-03 15:08:54 -0700
committerVicent Marti <tanoku@gmail.com>2013-07-10 20:50:32 +0200
commit5a169711fa9875bc98c30c49b5e9ea06ebbbcfeb (patch)
treec3705bdd2bc4fdb7e321ee99690290fd34806884 /examples/log.c
parent2b3bd8ecd88a403f9d034aa3a4d1e14c5e904255 (diff)
downloadlibgit2-5a169711fa9875bc98c30c49b5e9ea06ebbbcfeb.tar.gz
fix bug with order args and no revision
Diffstat (limited to 'examples/log.c')
-rw-r--r--examples/log.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/log.c b/examples/log.c
index 61b789263..f7aabf0b4 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))