diff options
author | John Keeping | 2013-03-02 12:32:11 +0000 |
---|---|---|
committer | Jason A. Donenfeld | 2013-03-02 10:38:03 -0500 |
commit | c1633c6befb6762e1ac9434a29980e4df5ffee21 (patch) | |
tree | 20dbdeab1f74e138a7db58a7ffb9ce304dcf3146 /ui-blob.c | |
parent | bfc14d067da0fdf65f306fcd9a65829d9694dbeb (diff) | |
download | cgit-c1633c6befb6762e1ac9434a29980e4df5ffee21.tar.gz cgit-c1633c6befb6762e1ac9434a29980e4df5ffee21.tar.bz2 cgit-c1633c6befb6762e1ac9434a29980e4df5ffee21.zip |
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-blob.c')
-rw-r--r-- | ui-blob.c | 22 |
1 files changed, 18 insertions, 4 deletions
@@ -32,7 +32,14 @@ int cgit_print_file(char *path, const char *head) | |||
32 | char *buf; | 32 | char *buf; |
33 | unsigned long size; | 33 | unsigned long size; |
34 | struct commit *commit; | 34 | struct commit *commit; |
35 | const char *paths[] = {path, NULL}; | 35 | struct pathspec_item path_items = { |
36 | .match = path, | ||
37 | .len = strlen(path) | ||
38 | }; | ||
39 | struct pathspec paths = { | ||
40 | .nr = 1, | ||
41 | .items = &path_items | ||
42 | }; | ||
36 | if (get_sha1(head, sha1)) | 43 | if (get_sha1(head, sha1)) |
37 | return -1; | 44 | return -1; |
38 | type = sha1_object_info(sha1, &size); | 45 | type = sha1_object_info(sha1, &size); |
@@ -41,7 +48,7 @@ int cgit_print_file(char *path, const char *head) | |||
41 | match_path = path; | 48 | match_path = path; |
42 | matched_sha1 = sha1; | 49 | matched_sha1 = sha1; |
43 | found_path = 0; | 50 | found_path = 0; |
44 | read_tree_recursive(commit->tree, "", 0, 0, paths, walk_tree, NULL); | 51 | read_tree_recursive(commit->tree, "", 0, 0, &paths, walk_tree, NULL); |
45 | if (!found_path) | 52 | if (!found_path) |
46 | return -1; | 53 | return -1; |
47 | type = sha1_object_info(sha1, &size); | 54 | type = sha1_object_info(sha1, &size); |
@@ -63,7 +70,14 @@ void cgit_print_blob(const char *hex, char *path, const char *head) | |||
63 | char *buf; | 70 | char *buf; |
64 | unsigned long size; | 71 | unsigned long size; |
65 | struct commit *commit; | 72 | struct commit *commit; |
66 | const char *paths[] = {path, NULL}; | 73 | struct pathspec_item path_items = { |
74 | .match = path, | ||
75 | .len = strlen(path) | ||
76 | }; | ||
77 | struct pathspec paths = { | ||
78 | .nr = 1, | ||
79 | .items = &path_items | ||
80 | }; | ||
67 | 81 | ||
68 | if (hex) { | 82 | if (hex) { |
69 | if (get_sha1_hex(hex, sha1)){ | 83 | if (get_sha1_hex(hex, sha1)){ |
@@ -83,7 +97,7 @@ void cgit_print_blob(const char *hex, char *path, const char *head) | |||
83 | commit = lookup_commit_reference(sha1); | 97 | commit = lookup_commit_reference(sha1); |
84 | match_path = path; | 98 | match_path = path; |
85 | matched_sha1 = sha1; | 99 | matched_sha1 = sha1; |
86 | read_tree_recursive(commit->tree, "", 0, 0, paths, walk_tree, NULL); | 100 | read_tree_recursive(commit->tree, "", 0, 0, &paths, walk_tree, NULL); |
87 | type = sha1_object_info(sha1,&size); | 101 | type = sha1_object_info(sha1,&size); |
88 | } | 102 | } |
89 | 103 | ||