author | Lars Hjemli <hjemli@gmail.com> | 2007-06-16 18:20:42 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2007-06-16 18:20:42 (UTC) |
commit | ffc69736a606fd8f9a10468cce48b9a37b428944 (patch) (unidiff) | |
tree | b080c702391244a525fa0e7c97758f7f7fa0c383 /cgit.c | |
parent | 849f0f0f02f858e21fbe59295846e51628f82915 (diff) | |
download | cgit-ffc69736a606fd8f9a10468cce48b9a37b428944.zip cgit-ffc69736a606fd8f9a10468cce48b9a37b428944.tar.gz cgit-ffc69736a606fd8f9a10468cce48b9a37b428944.tar.bz2 |
ui-tree: unify with ui-view, use path to select tree/blob
This teaches ui-tree to show both trees and blobs, thereby making ui-view
superfluous. At the same time, ui-tree is extended to honour the specified
path instead of requiering a tree/blob sha1.
-rw-r--r-- | cgit.c | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -84,40 +84,37 @@ static void cgit_print_repo_page(struct cacheitem *item) | |||
84 | if (!cgit_cmd) { | 84 | if (!cgit_cmd) { |
85 | cgit_print_pageheader("summary", show_search); | 85 | cgit_print_pageheader("summary", show_search); |
86 | cgit_print_summary(); | 86 | cgit_print_summary(); |
87 | cgit_print_docend(); | 87 | cgit_print_docend(); |
88 | return; | 88 | return; |
89 | } | 89 | } |
90 | 90 | ||
91 | cgit_print_pageheader(cgit_query_page, show_search); | 91 | cgit_print_pageheader(cgit_query_page, show_search); |
92 | 92 | ||
93 | switch(cgit_cmd) { | 93 | switch(cgit_cmd) { |
94 | case CMD_LOG: | 94 | case CMD_LOG: |
95 | cgit_print_log(cgit_query_head, cgit_query_ofs, | 95 | cgit_print_log(cgit_query_head, cgit_query_ofs, |
96 | cgit_max_commit_count, cgit_query_search, | 96 | cgit_max_commit_count, cgit_query_search, |
97 | cgit_query_path, 1); | 97 | cgit_query_path, 1); |
98 | break; | 98 | break; |
99 | case CMD_TREE: | 99 | case CMD_TREE: |
100 | cgit_print_tree(cgit_query_head, cgit_query_sha1, cgit_query_path); | 100 | cgit_print_tree(cgit_query_sha1, cgit_query_path); |
101 | break; | 101 | break; |
102 | case CMD_COMMIT: | 102 | case CMD_COMMIT: |
103 | cgit_print_commit(cgit_query_head); | 103 | cgit_print_commit(cgit_query_head); |
104 | break; | 104 | break; |
105 | case CMD_VIEW: | ||
106 | cgit_print_view(cgit_query_sha1, cgit_query_path); | ||
107 | break; | ||
108 | case CMD_DIFF: | 105 | case CMD_DIFF: |
109 | cgit_print_diff(cgit_query_head, cgit_query_sha1, cgit_query_sha2, | 106 | cgit_print_diff(cgit_query_head, cgit_query_sha1, cgit_query_sha2, |
110 | cgit_query_path); | 107 | cgit_query_path); |
111 | break; | 108 | break; |
112 | default: | 109 | default: |
113 | cgit_print_error("Invalid request"); | 110 | cgit_print_error("Invalid request"); |
114 | } | 111 | } |
115 | cgit_print_docend(); | 112 | cgit_print_docend(); |
116 | } | 113 | } |
117 | 114 | ||
118 | static void cgit_fill_cache(struct cacheitem *item, int use_cache) | 115 | static void cgit_fill_cache(struct cacheitem *item, int use_cache) |
119 | { | 116 | { |
120 | static char buf[PATH_MAX]; | 117 | static char buf[PATH_MAX]; |
121 | int stdout2; | 118 | int stdout2; |
122 | 119 | ||
123 | getcwd(buf, sizeof(buf)); | 120 | getcwd(buf, sizeof(buf)); |