diff options
author | John Keeping <john@keeping.me.uk> | 2013-03-02 21:32:11 (JST) |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2013-03-03 00:38:03 (JST) |
commit | c1633c6befb6762e1ac9434a29980e4df5ffee21 (patch) | |
tree | 20dbdeab1f74e138a7db58a7ffb9ce304dcf3146 /ui-plain.c | |
parent | bfc14d067da0fdf65f306fcd9a65829d9694dbeb (diff) | |
download | cgit-c1633c6befb6762e1ac9434a29980e4df5ffee21.zip cgit-c1633c6befb6762e1ac9434a29980e4df5ffee21.tar.gz |
Update git to v1.7.6.5
struct pathspec is now used in more places.
Signed-off-by: John Keeping <john@keeping.me.uk>
Diffstat (limited to 'ui-plain.c')
-rw-r--r-- | ui-plain.c | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -197,7 +197,14 @@ void cgit_print_plain(struct cgit_context *ctx) | |||
197 | const char *rev = ctx->qry.sha1; | 197 | const char *rev = ctx->qry.sha1; |
198 | unsigned char sha1[20]; | 198 | unsigned char sha1[20]; |
199 | struct commit *commit; | 199 | struct commit *commit; |
200 | const char *paths[] = {ctx->qry.path, NULL}; | 200 | struct pathspec_item path_items = { |
201 | .match = ctx->qry.path, | ||
202 | .len = ctx->qry.path ? strlen(ctx->qry.path) : 0 | ||
203 | }; | ||
204 | struct pathspec paths = { | ||
205 | .nr = 1, | ||
206 | .items = &path_items | ||
207 | }; | ||
201 | 208 | ||
202 | if (!rev) | 209 | if (!rev) |
203 | rev = ctx->qry.head; | 210 | rev = ctx->qry.head; |
@@ -211,14 +218,14 @@ void cgit_print_plain(struct cgit_context *ctx) | |||
211 | html_status(404, "Not found", 0); | 218 | html_status(404, "Not found", 0); |
212 | return; | 219 | return; |
213 | } | 220 | } |
214 | if (!paths[0]) { | 221 | if (!path_items.match) { |
215 | paths[0] = ""; | 222 | path_items.match = ""; |
216 | match_baselen = -1; | 223 | match_baselen = -1; |
217 | print_dir(commit->tree->object.sha1, "", 0, ""); | 224 | print_dir(commit->tree->object.sha1, "", 0, ""); |
218 | } | 225 | } |
219 | else | 226 | else |
220 | match_baselen = basedir_len(paths[0]); | 227 | match_baselen = basedir_len(path_items.match); |
221 | read_tree_recursive(commit->tree, "", 0, 0, paths, walk_tree, NULL); | 228 | read_tree_recursive(commit->tree, "", 0, 0, &paths, walk_tree, NULL); |
222 | if (!match) | 229 | if (!match) |
223 | html_status(404, "Not found", 0); | 230 | html_status(404, "Not found", 0); |
224 | else if (match == 2) | 231 | else if (match == 2) |