author | Lars Hjemli <hjemli@gmail.com> | 2007-07-22 21:42:55 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2007-07-22 21:44:57 (UTC) |
commit | 4e9107abfe8d3edff17826875b417bcf40dc7390 (patch) (unidiff) | |
tree | 96cfafa9b8838f34e1363ee3019eae64a6229b30 /cgit.c | |
parent | 71ebcbe23ab548e5c0ad40aa8be5741654ed3201 (diff) | |
download | cgit-4e9107abfe8d3edff17826875b417bcf40dc7390.zip cgit-4e9107abfe8d3edff17826875b417bcf40dc7390.tar.gz cgit-4e9107abfe8d3edff17826875b417bcf40dc7390.tar.bz2 |
Add ui-tag.c
This file implements the tag-command, i.e. printing of annotated tags.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | cgit.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -80,48 +80,51 @@ static void cgit_print_repo_page(struct cacheitem *item) | |||
80 | 80 | ||
81 | show_search = (cgit_cmd == CMD_LOG); | 81 | show_search = (cgit_cmd == CMD_LOG); |
82 | cgit_print_docstart(title, item); | 82 | cgit_print_docstart(title, item); |
83 | if (!cgit_cmd) { | 83 | if (!cgit_cmd) { |
84 | cgit_print_pageheader("summary", show_search); | 84 | cgit_print_pageheader("summary", show_search); |
85 | cgit_print_summary(); | 85 | cgit_print_summary(); |
86 | cgit_print_docend(); | 86 | cgit_print_docend(); |
87 | return; | 87 | return; |
88 | } | 88 | } |
89 | 89 | ||
90 | cgit_print_pageheader(cgit_query_page, show_search); | 90 | cgit_print_pageheader(cgit_query_page, show_search); |
91 | 91 | ||
92 | switch(cgit_cmd) { | 92 | switch(cgit_cmd) { |
93 | case CMD_LOG: | 93 | case CMD_LOG: |
94 | cgit_print_log(cgit_query_sha1, cgit_query_ofs, | 94 | cgit_print_log(cgit_query_sha1, cgit_query_ofs, |
95 | cgit_max_commit_count, cgit_query_search, | 95 | cgit_max_commit_count, cgit_query_search, |
96 | cgit_query_path, 1); | 96 | cgit_query_path, 1); |
97 | break; | 97 | break; |
98 | case CMD_TREE: | 98 | case CMD_TREE: |
99 | cgit_print_tree(cgit_query_sha1, cgit_query_path); | 99 | cgit_print_tree(cgit_query_sha1, cgit_query_path); |
100 | break; | 100 | break; |
101 | case CMD_COMMIT: | 101 | case CMD_COMMIT: |
102 | cgit_print_commit(cgit_query_sha1); | 102 | cgit_print_commit(cgit_query_sha1); |
103 | break; | 103 | break; |
104 | case CMD_TAG: | ||
105 | cgit_print_tag(cgit_query_sha1); | ||
106 | break; | ||
104 | case CMD_DIFF: | 107 | case CMD_DIFF: |
105 | cgit_print_diff(cgit_query_sha1, cgit_query_sha2); | 108 | cgit_print_diff(cgit_query_sha1, cgit_query_sha2); |
106 | break; | 109 | break; |
107 | default: | 110 | default: |
108 | cgit_print_error("Invalid request"); | 111 | cgit_print_error("Invalid request"); |
109 | } | 112 | } |
110 | cgit_print_docend(); | 113 | cgit_print_docend(); |
111 | } | 114 | } |
112 | 115 | ||
113 | static void cgit_fill_cache(struct cacheitem *item, int use_cache) | 116 | static void cgit_fill_cache(struct cacheitem *item, int use_cache) |
114 | { | 117 | { |
115 | static char buf[PATH_MAX]; | 118 | static char buf[PATH_MAX]; |
116 | int stdout2; | 119 | int stdout2; |
117 | 120 | ||
118 | getcwd(buf, sizeof(buf)); | 121 | getcwd(buf, sizeof(buf)); |
119 | item->st.st_mtime = time(NULL); | 122 | item->st.st_mtime = time(NULL); |
120 | 123 | ||
121 | if (use_cache) { | 124 | if (use_cache) { |
122 | stdout2 = chk_positive(dup(STDOUT_FILENO), | 125 | stdout2 = chk_positive(dup(STDOUT_FILENO), |
123 | "Preserving STDOUT"); | 126 | "Preserving STDOUT"); |
124 | chk_zero(close(STDOUT_FILENO), "Closing STDOUT"); | 127 | chk_zero(close(STDOUT_FILENO), "Closing STDOUT"); |
125 | chk_positive(dup2(item->fd, STDOUT_FILENO), "Dup2(cachefile)"); | 128 | chk_positive(dup2(item->fd, STDOUT_FILENO), "Dup2(cachefile)"); |
126 | } | 129 | } |
127 | 130 | ||