History

Merge branch 'jh/path-limit'

Lars Hjemli committed 16 years ago

Commit 37a24e42 parents 47187b3 a2cbd3c17 files · +275 −164Browse files

Showing the changes to ui-commit.c (1 of 17 files). Show all

Unified · Split

ui-commit.c+12−8
@@ -12,7 +12,7 @@ · 11 unmodified lines
1212 #include "ui-diff.h"
1313 #include "ui-log.h"
1414
15−void cgit_print_commit(char *hex)
15+void cgit_print_commit(char *hex, const char *prefix)
1616 {
1717 struct commit *commit, *parent;
1818 struct commitinfo *info, *parent_info;
@@ -58,19 +58,23 @@ void cgit_print_commit(char *hex) · 39 unmodified lines
5858 html("</td></tr>\n");
5959 html("<tr><th>commit</th><td colspan='2' class='sha1'>");
6060 tmp = sha1_to_hex(commit->object.sha1);
61− cgit_commit_link(tmp, NULL, NULL, ctx.qry.head, tmp, 0);
61+ cgit_commit_link(tmp, NULL, NULL, ctx.qry.head, tmp, prefix, 0);
6262 html(" (");
63− cgit_patch_link("patch", NULL, NULL, NULL, tmp);
63+ cgit_patch_link("patch", NULL, NULL, NULL, tmp, prefix);
6464 html(") (");
6565 if ((ctx.qry.ssdiff && !ctx.cfg.ssdiff) || (!ctx.qry.ssdiff && ctx.cfg.ssdiff))
66− cgit_commit_link("unidiff", NULL, NULL, ctx.qry.head, tmp, 1);
66+ cgit_commit_link("unidiff", NULL, NULL, ctx.qry.head, tmp, prefix, 1);
6767 else
68− cgit_commit_link("side-by-side diff", NULL, NULL, ctx.qry.head, tmp, 1);
68+ cgit_commit_link("side-by-side diff", NULL, NULL, ctx.qry.head, tmp, prefix, 1);
6969 html(")</td></tr>\n");
7070 html("<tr><th>tree</th><td colspan='2' class='sha1'>");
7171 tmp = xstrdup(hex);
7272 cgit_tree_link(sha1_to_hex(commit->tree->object.sha1), NULL, NULL,
7373 ctx.qry.head, tmp, NULL);
74+ if (prefix) {
75+ html(" /");
76+ cgit_tree_link(prefix, NULL, NULL, ctx.qry.head, tmp, prefix);
77+ }
7478 html("</td></tr>\n");
7579 for (p = commit->parents; p ; p = p->next) {
7680 parent = lookup_commit_reference(p->item->object.sha1);
@@ -87,10 +91,10 @@ void cgit_print_commit(char *hex) · 10 unmodified lines
8791 parent_info = cgit_parse_commit(parent);
8892 tmp2 = parent_info->subject;
8993 }
90− cgit_commit_link(tmp2, NULL, NULL, ctx.qry.head, tmp, 0);
94+ cgit_commit_link(tmp2, NULL, NULL, ctx.qry.head, tmp, prefix, 0);
9195 html(" (");
9296 cgit_diff_link("diff", NULL, NULL, ctx.qry.head, hex,
93− sha1_to_hex(p->item->object.sha1), NULL, 0);
97+ sha1_to_hex(p->item->object.sha1), prefix, 0);
9498 html(")</td></tr>");
9599 parents++;
96100 }
@@ -121,7 +125,7 @@ void cgit_print_commit(char *hex) · 24 unmodified lines
121125 tmp = sha1_to_hex(commit->parents->item->object.sha1);
122126 else
123127 tmp = NULL;
124− cgit_print_diff(ctx.qry.sha1, tmp, NULL);
128+ cgit_print_diff(ctx.qry.sha1, tmp, prefix);
125129 }
126130 cgit_free_commitinfo(info);
127131 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t