aboutsummaryrefslogtreecommitdiffstats
path: root/shared.c
diff options
context:
space:
mode:
authorLars Hjemli <hjemli@gmail.com>2007-06-17 18:12:03 +0200
committerLars Hjemli <hjemli@gmail.com>2007-06-17 18:12:03 +0200
commit4a0be586662843382ecfa53af34a13b291312bc0 (patch)
tree01e0cd725fe249df3449bb089aad9f8d58081f89 /shared.c
parentui-commit: use cgit_commit_link() for parent links (diff)
downloadcgit-4a0be586662843382ecfa53af34a13b291312bc0.tar.xz
cgit-4a0be586662843382ecfa53af34a13b291312bc0.zip
Add cgit_diff_link()
This adds a new function used to generate links to the diff page and uses it everywhere such links appear (expect for single files in the diffstat displayed on the commit page: this is now a link to the tree page). The updated diff-page now expects zero, one or two revision specifiers, in parameters head, id and id2. Id defaults to head unless otherwise specified, while head (as usual) defaults to repo.defbranch. If id2 isn't specified, it defaults to the first parent of id1. The most important change is of course that now all repo pages (summary, log, tree, commit and diff) has support for passing on the current branch and revision, i.e. the road is now open for a 'static' menu with links to all of these pages. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'shared.c')
-rw-r--r--shared.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/shared.c b/shared.c
index c7cd8a5..f20fb5c 100644
--- a/shared.c
+++ b/shared.c
@@ -360,7 +360,7 @@ void cgit_diff_tree(const unsigned char *old_sha1,
opt.format_callback_data = fn;
diff_setup_done(&opt);
- if (old_sha1)
+ if (old_sha1 && !is_null_sha1(old_sha1))
ret = diff_tree_sha1(old_sha1, new_sha1, "", &opt);
else
ret = diff_root_tree_sha1(new_sha1, "", &opt);