diff options
| -rw-r--r-- | cgit.c | 16 | ||||
| -rw-r--r-- | cgit.css | 2 | ||||
| -rw-r--r-- | cgit.h | 6 | ||||
| -rw-r--r-- | cmd.c | 18 | ||||
| -rw-r--r-- | parsing.c | 6 | ||||
| -rwxr-xr-x | tests/t0001-validate-git-versions.sh | 4 | ||||
| -rw-r--r-- | ui-blame.c | 4 | ||||
| -rw-r--r-- | ui-commit.c | 10 | ||||
| -rw-r--r-- | ui-diff.c | 8 | ||||
| -rw-r--r-- | ui-log.c | 6 | ||||
| -rw-r--r-- | ui-plain.c | 6 | ||||
| -rw-r--r-- | ui-shared.c | 40 | ||||
| -rw-r--r-- | ui-tag.c | 6 |
13 files changed, 66 insertions, 66 deletions
| @@ -324,11 +324,11 @@ static void querystring_cb(const char *name, const char *value) | |||
| 324 | ctx.qry.head = xstrdup(value); | 324 | ctx.qry.head = xstrdup(value); |
| 325 | ctx.qry.has_symref = 1; | 325 | ctx.qry.has_symref = 1; |
| 326 | } else if (!strcmp(name, "id")) { | 326 | } else if (!strcmp(name, "id")) { |
| 327 | ctx.qry.sha1 = xstrdup(value); | 327 | ctx.qry.oid = xstrdup(value); |
| 328 | ctx.qry.has_sha1 = 1; | 328 | ctx.qry.has_oid = 1; |
| 329 | } else if (!strcmp(name, "id2")) { | 329 | } else if (!strcmp(name, "id2")) { |
| 330 | ctx.qry.sha2 = xstrdup(value); | 330 | ctx.qry.oid2 = xstrdup(value); |
| 331 | ctx.qry.has_sha1 = 1; | 331 | ctx.qry.has_oid = 1; |
| 332 | } else if (!strcmp(name, "ofs")) { | 332 | } else if (!strcmp(name, "ofs")) { |
| 333 | ctx.qry.ofs = atoi(value); | 333 | ctx.qry.ofs = atoi(value); |
| 334 | } else if (!strcmp(name, "path")) { | 334 | } else if (!strcmp(name, "path")) { |
| @@ -992,9 +992,9 @@ static void cgit_parse_args(int argc, const char **argv) | |||
| 992 | } else if (skip_prefix(argv[i], "--head=", &arg)) { | 992 | } else if (skip_prefix(argv[i], "--head=", &arg)) { |
| 993 | ctx.qry.head = xstrdup(arg); | 993 | ctx.qry.head = xstrdup(arg); |
| 994 | ctx.qry.has_symref = 1; | 994 | ctx.qry.has_symref = 1; |
| 995 | } else if (skip_prefix(argv[i], "--sha1=", &arg)) { | 995 | } else if (skip_prefix(argv[i], "--oid=", &arg)) { |
| 996 | ctx.qry.sha1 = xstrdup(arg); | 996 | ctx.qry.oid = xstrdup(arg); |
| 997 | ctx.qry.has_sha1 = 1; | 997 | ctx.qry.has_oid = 1; |
| 998 | } else if (skip_prefix(argv[i], "--ofs=", &arg)) { | 998 | } else if (skip_prefix(argv[i], "--ofs=", &arg)) { |
| 999 | ctx.qry.ofs = atoi(arg); | 999 | ctx.qry.ofs = atoi(arg); |
| 1000 | } else if (skip_prefix(argv[i], "--scan-tree=", &arg) || | 1000 | } else if (skip_prefix(argv[i], "--scan-tree=", &arg) || |
| @@ -1037,7 +1037,7 @@ static int calc_ttl(void) | |||
| 1037 | if (!strcmp(ctx.qry.page, "snapshot")) | 1037 | if (!strcmp(ctx.qry.page, "snapshot")) |
| 1038 | return ctx.cfg.cache_snapshot_ttl; | 1038 | return ctx.cfg.cache_snapshot_ttl; |
| 1039 | 1039 | ||
| 1040 | if (ctx.qry.has_sha1) | 1040 | if (ctx.qry.has_oid) |
| 1041 | return ctx.cfg.cache_static_ttl; | 1041 | return ctx.cfg.cache_static_ttl; |
| 1042 | 1042 | ||
| 1043 | if (ctx.qry.has_symref) | 1043 | if (ctx.qry.has_symref) |
| @@ -561,7 +561,7 @@ div#cgit table.diff td div.del { | |||
| 561 | color: red; | 561 | color: red; |
| 562 | } | 562 | } |
| 563 | 563 | ||
| 564 | div#cgit .sha1 { | 564 | div#cgit .oid { |
| 565 | font-family: monospace; | 565 | font-family: monospace; |
| 566 | font-size: 90%; | 566 | font-size: 90%; |
| 567 | } | 567 | } |
| @@ -164,7 +164,7 @@ struct reflist { | |||
| 164 | 164 | ||
| 165 | struct cgit_query { | 165 | struct cgit_query { |
| 166 | int has_symref; | 166 | int has_symref; |
| 167 | int has_sha1; | 167 | int has_oid; |
| 168 | int has_difftype; | 168 | int has_difftype; |
| 169 | char *raw; | 169 | char *raw; |
| 170 | char *repo; | 170 | char *repo; |
| @@ -172,8 +172,8 @@ struct cgit_query { | |||
| 172 | char *search; | 172 | char *search; |
| 173 | char *grep; | 173 | char *grep; |
| 174 | char *head; | 174 | char *head; |
| 175 | char *sha1; | 175 | char *oid; |
| 176 | char *sha2; | 176 | char *oid2; |
| 177 | char *path; | 177 | char *path; |
| 178 | char *name; | 178 | char *name; |
| 179 | char *url; | 179 | char *url; |
| @@ -74,22 +74,22 @@ static void blame_fn(void) | |||
| 74 | 74 | ||
| 75 | static void blob_fn(void) | 75 | static void blob_fn(void) |
| 76 | { | 76 | { |
| 77 | cgit_print_blob(ctx.qry.sha1, ctx.qry.path, ctx.qry.head, 0); | 77 | cgit_print_blob(ctx.qry.oid, ctx.qry.path, ctx.qry.head, 0); |
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | static void commit_fn(void) | 80 | static void commit_fn(void) |
| 81 | { | 81 | { |
| 82 | cgit_print_commit(ctx.qry.sha1, ctx.qry.path); | 82 | cgit_print_commit(ctx.qry.oid, ctx.qry.path); |
| 83 | } | 83 | } |
| 84 | 84 | ||
| 85 | static void diff_fn(void) | 85 | static void diff_fn(void) |
| 86 | { | 86 | { |
| 87 | cgit_print_diff(ctx.qry.sha1, ctx.qry.sha2, ctx.qry.path, 1, 0); | 87 | cgit_print_diff(ctx.qry.oid, ctx.qry.oid2, ctx.qry.path, 1, 0); |
| 88 | } | 88 | } |
| 89 | 89 | ||
| 90 | static void rawdiff_fn(void) | 90 | static void rawdiff_fn(void) |
| 91 | { | 91 | { |
| 92 | cgit_print_diff(ctx.qry.sha1, ctx.qry.sha2, ctx.qry.path, 1, 1); | 92 | cgit_print_diff(ctx.qry.oid, ctx.qry.oid2, ctx.qry.path, 1, 1); |
| 93 | } | 93 | } |
| 94 | 94 | ||
| 95 | static void info_fn(void) | 95 | static void info_fn(void) |
| @@ -99,7 +99,7 @@ static void info_fn(void) | |||
| 99 | 99 | ||
| 100 | static void log_fn(void) | 100 | static void log_fn(void) |
| 101 | { | 101 | { |
| 102 | cgit_print_log(ctx.qry.sha1, ctx.qry.ofs, ctx.cfg.max_commit_count, | 102 | cgit_print_log(ctx.qry.oid, ctx.qry.ofs, ctx.cfg.max_commit_count, |
| 103 | ctx.qry.grep, ctx.qry.search, ctx.qry.path, 1, | 103 | ctx.qry.grep, ctx.qry.search, ctx.qry.path, 1, |
| 104 | ctx.repo->enable_commit_graph, | 104 | ctx.repo->enable_commit_graph, |
| 105 | ctx.repo->commit_sort); | 105 | ctx.repo->commit_sort); |
| @@ -125,7 +125,7 @@ static void repolist_fn(void) | |||
| 125 | 125 | ||
| 126 | static void patch_fn(void) | 126 | static void patch_fn(void) |
| 127 | { | 127 | { |
| 128 | cgit_print_patch(ctx.qry.sha1, ctx.qry.sha2, ctx.qry.path); | 128 | cgit_print_patch(ctx.qry.oid, ctx.qry.oid2, ctx.qry.path); |
| 129 | } | 129 | } |
| 130 | 130 | ||
| 131 | static void plain_fn(void) | 131 | static void plain_fn(void) |
| @@ -140,7 +140,7 @@ static void refs_fn(void) | |||
| 140 | 140 | ||
| 141 | static void snapshot_fn(void) | 141 | static void snapshot_fn(void) |
| 142 | { | 142 | { |
| 143 | cgit_print_snapshot(ctx.qry.head, ctx.qry.sha1, ctx.qry.path, | 143 | cgit_print_snapshot(ctx.qry.head, ctx.qry.oid, ctx.qry.path, |
| 144 | ctx.qry.nohead); | 144 | ctx.qry.nohead); |
| 145 | } | 145 | } |
| 146 | 146 | ||
| @@ -156,12 +156,12 @@ static void summary_fn(void) | |||
| 156 | 156 | ||
| 157 | static void tag_fn(void) | 157 | static void tag_fn(void) |
| 158 | { | 158 | { |
| 159 | cgit_print_tag(ctx.qry.sha1); | 159 | cgit_print_tag(ctx.qry.oid); |
| 160 | } | 160 | } |
| 161 | 161 | ||
| 162 | static void tree_fn(void) | 162 | static void tree_fn(void) |
| 163 | { | 163 | { |
| 164 | cgit_print_tree(ctx.qry.sha1, ctx.qry.path); | 164 | cgit_print_tree(ctx.qry.oid, ctx.qry.path); |
| 165 | } | 165 | } |
| 166 | 166 | ||
| 167 | #define def_cmd(name, want_repo, want_vpath, is_clone) \ | 167 | #define def_cmd(name, want_repo, want_vpath, is_clone) \ |
| @@ -127,7 +127,7 @@ static int end_of_header(const char *p) | |||
| 127 | 127 | ||
| 128 | struct commitinfo *cgit_parse_commit(struct commit *commit) | 128 | struct commitinfo *cgit_parse_commit(struct commit *commit) |
| 129 | { | 129 | { |
| 130 | const int sha1hex_len = 40; | 130 | const int oid_hex_len = 40; |
| 131 | struct commitinfo *ret; | 131 | struct commitinfo *ret; |
| 132 | const char *p = repo_get_commit_buffer(the_repository, commit, NULL); | 132 | const char *p = repo_get_commit_buffer(the_repository, commit, NULL); |
| 133 | const char *t; | 133 | const char *t; |
| @@ -140,10 +140,10 @@ struct commitinfo *cgit_parse_commit(struct commit *commit) | |||
| 140 | 140 | ||
| 141 | if (!skip_prefix(p, "tree ", &p)) | 141 | if (!skip_prefix(p, "tree ", &p)) |
| 142 | die("Bad commit: %s", oid_to_hex(&commit->object.oid)); | 142 | die("Bad commit: %s", oid_to_hex(&commit->object.oid)); |
| 143 | p += sha1hex_len + 1; | 143 | p += oid_hex_len + 1; |
| 144 | 144 | ||
| 145 | while (skip_prefix(p, "parent ", &p)) | 145 | while (skip_prefix(p, "parent ", &p)) |
| 146 | p += sha1hex_len + 1; | 146 | p += oid_hex_len + 1; |
| 147 | 147 | ||
| 148 | if (p && skip_prefix(p, "author ", &p)) { | 148 | if (p && skip_prefix(p, "author ", &p)) { |
| 149 | parse_user(p, &ret->author, &ret->author_email, | 149 | parse_user(p, &ret->author, &ret->author_email, |
diff --git a/tests/t0001-validate-git-versions.sh b/tests/t0001-validate-git-versions.sh index 73bd32f..dd84fe3 100755 --- a/tests/t0001-validate-git-versions.sh +++ b/tests/t0001-validate-git-versions.sh | |||
| @@ -33,10 +33,10 @@ test_expect_success 'test submodule version matches Makefile' ' | |||
| 33 | else | 33 | else |
| 34 | ( | 34 | ( |
| 35 | cd ../.. && | 35 | cd ../.. && |
| 36 | sm_sha1=$(git ls-files --stage -- git | | 36 | sm_oid=$(git ls-files --stage -- git | |
| 37 | sed -e "s/^[0-9]* \\([0-9a-f]*\\) [0-9] .*$/\\1/") && | 37 | sed -e "s/^[0-9]* \\([0-9a-f]*\\) [0-9] .*$/\\1/") && |
| 38 | cd git && | 38 | cd git && |
| 39 | git describe --match "v[0-9]*" $sm_sha1 | 39 | git describe --match "v[0-9]*" $sm_oid |
| 40 | ) | sed -e "s/^v//" -e "s/-/./" >sm_version && | 40 | ) | sed -e "s/^v//" -e "s/-/./" >sm_version && |
| 41 | test_cmp sm_version makefile_version | 41 | test_cmp sm_version makefile_version |
| 42 | fi | 42 | fi |
| @@ -48,7 +48,7 @@ static void emit_blame_entry_hash(struct blame_entry *ent) | |||
| 48 | unsigned long line = 0; | 48 | unsigned long line = 0; |
| 49 | 49 | ||
| 50 | char *detail = emit_suspect_detail(suspect); | 50 | char *detail = emit_suspect_detail(suspect); |
| 51 | html("<span class='sha1'>"); | 51 | html("<span class='oid'>"); |
| 52 | cgit_commit_link(find_unique_abbrev(oid, DEFAULT_ABBREV), detail, | 52 | cgit_commit_link(find_unique_abbrev(oid, DEFAULT_ABBREV), detail, |
| 53 | NULL, ctx.qry.head, oid_to_hex(oid), suspect->path); | 53 | NULL, ctx.qry.head, oid_to_hex(oid), suspect->path); |
| 54 | html("</span>"); | 54 | html("</span>"); |
| @@ -256,7 +256,7 @@ static int basedir_len(const char *path) | |||
| 256 | 256 | ||
| 257 | void cgit_print_blame(void) | 257 | void cgit_print_blame(void) |
| 258 | { | 258 | { |
| 259 | const char *rev = ctx.qry.sha1; | 259 | const char *rev = ctx.qry.oid; |
| 260 | struct object_id oid; | 260 | struct object_id oid; |
| 261 | struct commit *commit; | 261 | struct commit *commit; |
| 262 | struct pathspec_item path_items = { | 262 | struct pathspec_item path_items = { |
diff --git a/ui-commit.c b/ui-commit.c index 783211f..948118c 100644 --- a/ui-commit.c +++ b/ui-commit.c | |||
| @@ -70,13 +70,13 @@ void cgit_print_commit(char *hex, const char *prefix) | |||
| 70 | html_txt(show_date(info->committer_date, info->committer_tz, | 70 | html_txt(show_date(info->committer_date, info->committer_tz, |
| 71 | cgit_date_mode(DATE_ISO8601))); | 71 | cgit_date_mode(DATE_ISO8601))); |
| 72 | html("</td></tr>\n"); | 72 | html("</td></tr>\n"); |
| 73 | html("<tr><th>commit</th><td colspan='2' class='sha1'>"); | 73 | html("<tr><th>commit</th><td colspan='2' class='oid'>"); |
| 74 | tmp = oid_to_hex(&commit->object.oid); | 74 | tmp = oid_to_hex(&commit->object.oid); |
| 75 | cgit_commit_link(tmp, NULL, NULL, ctx.qry.head, tmp, prefix); | 75 | cgit_commit_link(tmp, NULL, NULL, ctx.qry.head, tmp, prefix); |
| 76 | html(" ("); | 76 | html(" ("); |
| 77 | cgit_patch_link("patch", NULL, NULL, NULL, tmp, prefix); | 77 | cgit_patch_link("patch", NULL, NULL, NULL, tmp, prefix); |
| 78 | html(")</td></tr>\n"); | 78 | html(")</td></tr>\n"); |
| 79 | html("<tr><th>tree</th><td colspan='2' class='sha1'>"); | 79 | html("<tr><th>tree</th><td colspan='2' class='oid'>"); |
| 80 | tmp = xstrdup(hex); | 80 | tmp = xstrdup(hex); |
| 81 | cgit_tree_link(oid_to_hex(get_commit_tree_oid(commit)), NULL, NULL, | 81 | cgit_tree_link(oid_to_hex(get_commit_tree_oid(commit)), NULL, NULL, |
| 82 | ctx.qry.head, tmp, NULL); | 82 | ctx.qry.head, tmp, NULL); |
| @@ -95,7 +95,7 @@ void cgit_print_commit(char *hex, const char *prefix) | |||
| 95 | continue; | 95 | continue; |
| 96 | } | 96 | } |
| 97 | html("<tr><th>parent</th>" | 97 | html("<tr><th>parent</th>" |
| 98 | "<td colspan='2' class='sha1'>"); | 98 | "<td colspan='2' class='oid'>"); |
| 99 | tmp = tmp2 = oid_to_hex(&p->item->object.oid); | 99 | tmp = tmp2 = oid_to_hex(&p->item->object.oid); |
| 100 | if (ctx.repo->enable_subject_links) { | 100 | if (ctx.repo->enable_subject_links) { |
| 101 | parent_info = cgit_parse_commit(parent); | 101 | parent_info = cgit_parse_commit(parent); |
| @@ -109,7 +109,7 @@ void cgit_print_commit(char *hex, const char *prefix) | |||
| 109 | parents++; | 109 | parents++; |
| 110 | } | 110 | } |
| 111 | if (ctx.repo->snapshots) { | 111 | if (ctx.repo->snapshots) { |
| 112 | html("<tr><th>download</th><td colspan='2' class='sha1'>"); | 112 | html("<tr><th>download</th><td colspan='2' class='oid'>"); |
| 113 | cgit_print_snapshot_links(ctx.repo, hex, "<br/>"); | 113 | cgit_print_snapshot_links(ctx.repo, hex, "<br/>"); |
| 114 | html("</td></tr>"); | 114 | html("</td></tr>"); |
| 115 | } | 115 | } |
| @@ -139,7 +139,7 @@ void cgit_print_commit(char *hex, const char *prefix) | |||
| 139 | tmp = oid_to_hex(&commit->parents->item->object.oid); | 139 | tmp = oid_to_hex(&commit->parents->item->object.oid); |
| 140 | else | 140 | else |
| 141 | tmp = NULL; | 141 | tmp = NULL; |
| 142 | cgit_print_diff(ctx.qry.sha1, tmp, prefix, 0, 0); | 142 | cgit_print_diff(ctx.qry.oid, tmp, prefix, 0, 0); |
| 143 | } | 143 | } |
| 144 | strbuf_release(¬es); | 144 | strbuf_release(¬es); |
| 145 | cgit_free_commitinfo(info); | 145 | cgit_free_commitinfo(info); |
| @@ -97,8 +97,8 @@ static void print_fileinfo(struct fileinfo *info) | |||
| 97 | html("]</span>"); | 97 | html("]</span>"); |
| 98 | } | 98 | } |
| 99 | htmlf("</td><td class='%s'>", class); | 99 | htmlf("</td><td class='%s'>", class); |
| 100 | cgit_diff_link(info->new_path, NULL, NULL, ctx.qry.head, ctx.qry.sha1, | 100 | cgit_diff_link(info->new_path, NULL, NULL, ctx.qry.head, ctx.qry.oid, |
| 101 | ctx.qry.sha2, info->new_path); | 101 | ctx.qry.oid2, info->new_path); |
| 102 | if (info->status == DIFF_STATUS_COPIED || info->status == DIFF_STATUS_RENAMED) { | 102 | if (info->status == DIFF_STATUS_COPIED || info->status == DIFF_STATUS_RENAMED) { |
| 103 | htmlf(" (%s from ", | 103 | htmlf(" (%s from ", |
| 104 | info->status == DIFF_STATUS_COPIED ? "copied" : "renamed"); | 104 | info->status == DIFF_STATUS_COPIED ? "copied" : "renamed"); |
| @@ -194,8 +194,8 @@ static void cgit_print_diffstat(const struct object_id *old_oid, | |||
| 194 | int i; | 194 | int i; |
| 195 | 195 | ||
| 196 | html("<div class='diffstat-header'>"); | 196 | html("<div class='diffstat-header'>"); |
| 197 | cgit_diff_link("Diffstat", NULL, NULL, ctx.qry.head, ctx.qry.sha1, | 197 | cgit_diff_link("Diffstat", NULL, NULL, ctx.qry.head, ctx.qry.oid, |
| 198 | ctx.qry.sha2, NULL); | 198 | ctx.qry.oid2, NULL); |
| 199 | if (prefix) { | 199 | if (prefix) { |
| 200 | html(" (limited to '"); | 200 | html(" (limited to '"); |
| 201 | html_txt(prefix); | 201 | html_txt(prefix); |
| @@ -463,7 +463,7 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern | |||
| 463 | if (pager) { | 463 | if (pager) { |
| 464 | html(" ("); | 464 | html(" ("); |
| 465 | cgit_log_link(ctx.qry.showmsg ? "Collapse" : "Expand", NULL, | 465 | cgit_log_link(ctx.qry.showmsg ? "Collapse" : "Expand", NULL, |
| 466 | NULL, ctx.qry.head, ctx.qry.sha1, | 466 | NULL, ctx.qry.head, ctx.qry.oid, |
| 467 | ctx.qry.vpath, ctx.qry.ofs, ctx.qry.grep, | 467 | ctx.qry.vpath, ctx.qry.ofs, ctx.qry.grep, |
| 468 | ctx.qry.search, ctx.qry.showmsg ? 0 : 1, | 468 | ctx.qry.search, ctx.qry.showmsg ? 0 : 1, |
| 469 | ctx.qry.follow); | 469 | ctx.qry.follow); |
| @@ -519,7 +519,7 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern | |||
| 519 | if (ofs > 0) { | 519 | if (ofs > 0) { |
| 520 | html("<li>"); | 520 | html("<li>"); |
| 521 | cgit_log_link("[prev]", NULL, NULL, ctx.qry.head, | 521 | cgit_log_link("[prev]", NULL, NULL, ctx.qry.head, |
| 522 | ctx.qry.sha1, ctx.qry.vpath, | 522 | ctx.qry.oid, ctx.qry.vpath, |
| 523 | ofs - cnt, ctx.qry.grep, | 523 | ofs - cnt, ctx.qry.grep, |
| 524 | ctx.qry.search, ctx.qry.showmsg, | 524 | ctx.qry.search, ctx.qry.showmsg, |
| 525 | ctx.qry.follow); | 525 | ctx.qry.follow); |
| @@ -528,7 +528,7 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern | |||
| 528 | if ((commit = get_revision(&rev)) != NULL) { | 528 | if ((commit = get_revision(&rev)) != NULL) { |
| 529 | html("<li>"); | 529 | html("<li>"); |
| 530 | cgit_log_link("[next]", NULL, NULL, ctx.qry.head, | 530 | cgit_log_link("[next]", NULL, NULL, ctx.qry.head, |
| 531 | ctx.qry.sha1, ctx.qry.vpath, | 531 | ctx.qry.oid, ctx.qry.vpath, |
| 532 | ofs + cnt, ctx.qry.grep, | 532 | ofs + cnt, ctx.qry.grep, |
| 533 | ctx.qry.search, ctx.qry.showmsg, | 533 | ctx.qry.search, ctx.qry.showmsg, |
| 534 | ctx.qry.follow); | 534 | ctx.qry.follow); |
| @@ -99,7 +99,7 @@ static void print_dir(const struct object_id *oid, const char *base, | |||
| 99 | fullpath = NULL; | 99 | fullpath = NULL; |
| 100 | } | 100 | } |
| 101 | html("<li>"); | 101 | html("<li>"); |
| 102 | cgit_plain_link("../", NULL, NULL, ctx.qry.head, ctx.qry.sha1, | 102 | cgit_plain_link("../", NULL, NULL, ctx.qry.head, ctx.qry.oid, |
| 103 | fullpath); | 103 | fullpath); |
| 104 | html("</li>\n"); | 104 | html("</li>\n"); |
| 105 | } | 105 | } |
| @@ -118,7 +118,7 @@ static void print_dir_entry(const struct object_id *oid, const char *base, | |||
| 118 | if (S_ISGITLINK(mode)) { | 118 | if (S_ISGITLINK(mode)) { |
| 119 | cgit_submodule_link(NULL, fullpath, oid_to_hex(oid)); | 119 | cgit_submodule_link(NULL, fullpath, oid_to_hex(oid)); |
| 120 | } else | 120 | } else |
| 121 | cgit_plain_link(path, NULL, NULL, ctx.qry.head, ctx.qry.sha1, | 121 | cgit_plain_link(path, NULL, NULL, ctx.qry.head, ctx.qry.oid, |
| 122 | fullpath); | 122 | fullpath); |
| 123 | html("</li>\n"); | 123 | html("</li>\n"); |
| 124 | free(fullpath); | 124 | free(fullpath); |
| @@ -163,7 +163,7 @@ static int basedir_len(const char *path) | |||
| 163 | 163 | ||
| 164 | void cgit_print_plain(void) | 164 | void cgit_print_plain(void) |
| 165 | { | 165 | { |
| 166 | const char *rev = ctx.qry.sha1; | 166 | const char *rev = ctx.qry.oid; |
| 167 | struct object_id oid; | 167 | struct object_id oid; |
| 168 | struct commit *commit; | 168 | struct commit *commit; |
| 169 | struct pathspec_item path_items = { | 169 | struct pathspec_item path_items = { |
diff --git a/ui-shared.c b/ui-shared.c index d2358f2..151ac17 100644 --- a/ui-shared.c +++ b/ui-shared.c | |||
| @@ -521,45 +521,45 @@ static void cgit_self_link(char *name, const char *title, const char *class) | |||
| 521 | else if (!strcmp(ctx.qry.page, "summary")) | 521 | else if (!strcmp(ctx.qry.page, "summary")) |
| 522 | cgit_summary_link(name, title, class, ctx.qry.head); | 522 | cgit_summary_link(name, title, class, ctx.qry.head); |
| 523 | else if (!strcmp(ctx.qry.page, "tag")) | 523 | else if (!strcmp(ctx.qry.page, "tag")) |
| 524 | cgit_tag_link(name, title, class, ctx.qry.has_sha1 ? | 524 | cgit_tag_link(name, title, class, ctx.qry.has_oid ? |
| 525 | ctx.qry.sha1 : ctx.qry.head); | 525 | ctx.qry.oid : ctx.qry.head); |
| 526 | else if (!strcmp(ctx.qry.page, "tree")) | 526 | else if (!strcmp(ctx.qry.page, "tree")) |
| 527 | cgit_tree_link(name, title, class, ctx.qry.head, | 527 | cgit_tree_link(name, title, class, ctx.qry.head, |
| 528 | ctx.qry.has_sha1 ? ctx.qry.sha1 : NULL, | 528 | ctx.qry.has_oid ? ctx.qry.oid : NULL, |
| 529 | ctx.qry.path); | 529 | ctx.qry.path); |
| 530 | else if (!strcmp(ctx.qry.page, "plain")) | 530 | else if (!strcmp(ctx.qry.page, "plain")) |
| 531 | cgit_plain_link(name, title, class, ctx.qry.head, | 531 | cgit_plain_link(name, title, class, ctx.qry.head, |
| 532 | ctx.qry.has_sha1 ? ctx.qry.sha1 : NULL, | 532 | ctx.qry.has_oid ? ctx.qry.oid : NULL, |
| 533 | ctx.qry.path); | 533 | ctx.qry.path); |
| 534 | else if (!strcmp(ctx.qry.page, "blame")) | 534 | else if (!strcmp(ctx.qry.page, "blame")) |
| 535 | cgit_blame_link(name, title, class, ctx.qry.head, | 535 | cgit_blame_link(name, title, class, ctx.qry.head, |
| 536 | ctx.qry.has_sha1 ? ctx.qry.sha1 : NULL, | 536 | ctx.qry.has_oid ? ctx.qry.oid : NULL, |
| 537 | ctx.qry.path); | 537 | ctx.qry.path); |
| 538 | else if (!strcmp(ctx.qry.page, "log")) | 538 | else if (!strcmp(ctx.qry.page, "log")) |
| 539 | cgit_log_link(name, title, class, ctx.qry.head, | 539 | cgit_log_link(name, title, class, ctx.qry.head, |
| 540 | ctx.qry.has_sha1 ? ctx.qry.sha1 : NULL, | 540 | ctx.qry.has_oid ? ctx.qry.oid : NULL, |
| 541 | ctx.qry.path, ctx.qry.ofs, | 541 | ctx.qry.path, ctx.qry.ofs, |
| 542 | ctx.qry.grep, ctx.qry.search, | 542 | ctx.qry.grep, ctx.qry.search, |
| 543 | ctx.qry.showmsg, ctx.qry.follow); | 543 | ctx.qry.showmsg, ctx.qry.follow); |
| 544 | else if (!strcmp(ctx.qry.page, "commit")) | 544 | else if (!strcmp(ctx.qry.page, "commit")) |
| 545 | cgit_commit_link(name, title, class, ctx.qry.head, | 545 | cgit_commit_link(name, title, class, ctx.qry.head, |
| 546 | ctx.qry.has_sha1 ? ctx.qry.sha1 : NULL, | 546 | ctx.qry.has_oid ? ctx.qry.oid : NULL, |
| 547 | ctx.qry.path); | 547 | ctx.qry.path); |
| 548 | else if (!strcmp(ctx.qry.page, "patch")) | 548 | else if (!strcmp(ctx.qry.page, "patch")) |
| 549 | cgit_patch_link(name, title, class, ctx.qry.head, | 549 | cgit_patch_link(name, title, class, ctx.qry.head, |
| 550 | ctx.qry.has_sha1 ? ctx.qry.sha1 : NULL, | 550 | ctx.qry.has_oid ? ctx.qry.oid : NULL, |
| 551 | ctx.qry.path); | 551 | ctx.qry.path); |
| 552 | else if (!strcmp(ctx.qry.page, "refs")) | 552 | else if (!strcmp(ctx.qry.page, "refs")) |
| 553 | cgit_refs_link(name, title, class, ctx.qry.head, | 553 | cgit_refs_link(name, title, class, ctx.qry.head, |
| 554 | ctx.qry.has_sha1 ? ctx.qry.sha1 : NULL, | 554 | ctx.qry.has_oid ? ctx.qry.oid : NULL, |
| 555 | ctx.qry.path); | 555 | ctx.qry.path); |
| 556 | else if (!strcmp(ctx.qry.page, "snapshot")) | 556 | else if (!strcmp(ctx.qry.page, "snapshot")) |
| 557 | cgit_snapshot_link(name, title, class, ctx.qry.head, | 557 | cgit_snapshot_link(name, title, class, ctx.qry.head, |
| 558 | ctx.qry.has_sha1 ? ctx.qry.sha1 : NULL, | 558 | ctx.qry.has_oid ? ctx.qry.oid : NULL, |
| 559 | ctx.qry.path); | 559 | ctx.qry.path); |
| 560 | else if (!strcmp(ctx.qry.page, "diff")) | 560 | else if (!strcmp(ctx.qry.page, "diff")) |
| 561 | cgit_diff_link(name, title, class, ctx.qry.head, | 561 | cgit_diff_link(name, title, class, ctx.qry.head, |
| 562 | ctx.qry.sha1, ctx.qry.sha2, | 562 | ctx.qry.oid, ctx.qry.oid2, |
| 563 | ctx.qry.path); | 563 | ctx.qry.path); |
| 564 | else if (!strcmp(ctx.qry.page, "stats")) | 564 | else if (!strcmp(ctx.qry.page, "stats")) |
| 565 | cgit_stats_link(name, title, class, ctx.qry.head, | 565 | cgit_stats_link(name, title, class, ctx.qry.head, |
| @@ -918,10 +918,10 @@ void cgit_add_hidden_formfields(int incl_head, int incl_search, | |||
| 918 | strcmp(ctx.qry.head, ctx.repo->defbranch)) | 918 | strcmp(ctx.qry.head, ctx.repo->defbranch)) |
| 919 | html_hidden("h", ctx.qry.head); | 919 | html_hidden("h", ctx.qry.head); |
| 920 | 920 | ||
| 921 | if (ctx.qry.sha1) | 921 | if (ctx.qry.oid) |
| 922 | html_hidden("id", ctx.qry.sha1); | 922 | html_hidden("id", ctx.qry.oid); |
| 923 | if (ctx.qry.sha2) | 923 | if (ctx.qry.oid2) |
| 924 | html_hidden("id2", ctx.qry.sha2); | 924 | html_hidden("id2", ctx.qry.oid2); |
| 925 | if (ctx.qry.showmsg) | 925 | if (ctx.qry.showmsg) |
| 926 | html_hidden("showmsg", "1"); | 926 | html_hidden("showmsg", "1"); |
| 927 | 927 | ||
| @@ -1038,20 +1038,20 @@ void cgit_print_pageheader(void) | |||
| 1038 | cgit_summary_link("summary", NULL, hc("summary"), | 1038 | cgit_summary_link("summary", NULL, hc("summary"), |
| 1039 | ctx.qry.head); | 1039 | ctx.qry.head); |
| 1040 | cgit_refs_link("refs", NULL, hc("refs"), ctx.qry.head, | 1040 | cgit_refs_link("refs", NULL, hc("refs"), ctx.qry.head, |
| 1041 | ctx.qry.sha1, NULL); | 1041 | ctx.qry.oid, NULL); |
| 1042 | cgit_log_link("log", NULL, hc("log"), ctx.qry.head, | 1042 | cgit_log_link("log", NULL, hc("log"), ctx.qry.head, |
| 1043 | NULL, ctx.qry.vpath, 0, NULL, NULL, | 1043 | NULL, ctx.qry.vpath, 0, NULL, NULL, |
| 1044 | ctx.qry.showmsg, ctx.qry.follow); | 1044 | ctx.qry.showmsg, ctx.qry.follow); |
| 1045 | if (ctx.qry.page && !strcmp(ctx.qry.page, "blame")) | 1045 | if (ctx.qry.page && !strcmp(ctx.qry.page, "blame")) |
| 1046 | cgit_blame_link("blame", NULL, hc("blame"), ctx.qry.head, | 1046 | cgit_blame_link("blame", NULL, hc("blame"), ctx.qry.head, |
| 1047 | ctx.qry.sha1, ctx.qry.vpath); | 1047 | ctx.qry.oid, ctx.qry.vpath); |
| 1048 | else | 1048 | else |
| 1049 | cgit_tree_link("tree", NULL, hc("tree"), ctx.qry.head, | 1049 | cgit_tree_link("tree", NULL, hc("tree"), ctx.qry.head, |
| 1050 | ctx.qry.sha1, ctx.qry.vpath); | 1050 | ctx.qry.oid, ctx.qry.vpath); |
| 1051 | cgit_commit_link("commit", NULL, hc("commit"), | 1051 | cgit_commit_link("commit", NULL, hc("commit"), |
| 1052 | ctx.qry.head, ctx.qry.sha1, ctx.qry.vpath); | 1052 | ctx.qry.head, ctx.qry.oid, ctx.qry.vpath); |
| 1053 | cgit_diff_link("diff", NULL, hc("diff"), ctx.qry.head, | 1053 | cgit_diff_link("diff", NULL, hc("diff"), ctx.qry.head, |
| 1054 | ctx.qry.sha1, ctx.qry.sha2, ctx.qry.vpath); | 1054 | ctx.qry.oid, ctx.qry.oid2, ctx.qry.vpath); |
| 1055 | if (ctx.repo->max_stats) | 1055 | if (ctx.repo->max_stats) |
| 1056 | cgit_stats_link("stats", NULL, hc("stats"), | 1056 | cgit_stats_link("stats", NULL, hc("stats"), |
| 1057 | ctx.qry.head, ctx.qry.vpath); | 1057 | ctx.qry.head, ctx.qry.vpath); |
| @@ -33,7 +33,7 @@ static void print_tag_content(char *buf) | |||
| 33 | 33 | ||
| 34 | static void print_download_links(char *revname) | 34 | static void print_download_links(char *revname) |
| 35 | { | 35 | { |
| 36 | html("<tr><th>download</th><td class='sha1'>"); | 36 | html("<tr><th>download</th><td class='oid'>"); |
| 37 | cgit_print_snapshot_links(ctx.repo, revname, "<br/>"); | 37 | cgit_print_snapshot_links(ctx.repo, revname, "<br/>"); |
| 38 | html("</td></tr>"); | 38 | html("</td></tr>"); |
| 39 | } | 39 | } |
| @@ -91,7 +91,7 @@ void cgit_print_tag(char *revname) | |||
| 91 | cgit_close_filter(ctx.repo->email_filter); | 91 | cgit_close_filter(ctx.repo->email_filter); |
| 92 | html("</td></tr>\n"); | 92 | html("</td></tr>\n"); |
| 93 | } | 93 | } |
| 94 | html("<tr><td>tagged object</td><td class='sha1'>"); | 94 | html("<tr><td>tagged object</td><td class='oid'>"); |
| 95 | cgit_object_link(tag->tagged); | 95 | cgit_object_link(tag->tagged); |
| 96 | html("</td></tr>\n"); | 96 | html("</td></tr>\n"); |
| 97 | if (ctx.repo->snapshots) | 97 | if (ctx.repo->snapshots) |
| @@ -106,7 +106,7 @@ void cgit_print_tag(char *revname) | |||
| 106 | html("<tr><td>tag name</td><td>"); | 106 | html("<tr><td>tag name</td><td>"); |
| 107 | html_txt(revname); | 107 | html_txt(revname); |
| 108 | html("</td></tr>\n"); | 108 | html("</td></tr>\n"); |
| 109 | html("<tr><td>tagged object</td><td class='sha1'>"); | 109 | html("<tr><td>tagged object</td><td class='oid'>"); |
| 110 | cgit_object_link(obj); | 110 | cgit_object_link(obj); |
| 111 | html("</td></tr>\n"); | 111 | html("</td></tr>\n"); |
| 112 | if (ctx.repo->snapshots) | 112 | if (ctx.repo->snapshots) |
