summaryrefslogtreecommitdiff
path: root/ui-diff.c
diff options
context:
space:
mode:
authorLars Hjemli <hjemli@gmail.com>2011-05-23 23:26:10 +0200
committerLars Hjemli <hjemli@gmail.com>2011-05-23 23:26:10 +0200
commit652a5a18db3b0409fedfaf8c5720446d87628ba0 (patch)
treecefa386058d968217af24374b93972820a9b43a8 /ui-diff.c
parent4837fddc35bbd8d6f66a40486f75cdee3197172d (diff)
parentec79265f2053e6dc20e0ec486719f5954d2be83d (diff)
Merge branch 'stable'
Diffstat (limited to 'ui-diff.c')
-rw-r--r--ui-diff.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/ui-diff.c b/ui-diff.c
index a7bc667..d21541b 100644
--- a/ui-diff.c
+++ b/ui-diff.c
@@ -345,8 +345,10 @@ void cgit_print_diff(const char *new_rev, const char *old_rev, const char *prefi
return;
}
commit = lookup_commit_reference(new_rev_sha1);
- if (!commit || parse_commit(commit))
+ if (!commit || parse_commit(commit)) {
cgit_print_error(fmt("Bad commit: %s", sha1_to_hex(new_rev_sha1)));
+ return;
+ }
if (old_rev)
get_sha1(old_rev, old_rev_sha1);
@@ -362,8 +364,10 @@ void cgit_print_diff(const char *new_rev, const char *old_rev, const char *prefi
return;
}
commit2 = lookup_commit_reference(old_rev_sha1);
- if (!commit2 || parse_commit(commit2))
+ if (!commit2 || parse_commit(commit2)) {
cgit_print_error(fmt("Bad commit: %s", sha1_to_hex(old_rev_sha1)));
+ return;
+ }
}
if ((ctx.qry.ssdiff && !ctx.cfg.ssdiff) || (!ctx.qry.ssdiff && ctx.cfg.ssdiff))