diff options
author | Christian Hesse | 2015-02-07 14:18:28 +0100 |
---|---|---|
committer | Jason A. Donenfeld | 2015-02-08 18:11:09 +0100 |
commit | 7358f63015a27d1c22816a3c1f734c3d4beed115 (patch) | |
tree | 5cb35efdca25827a939623c13c2513302976291b | |
parent | ui-shared.c: Refactor add_clone_urls() (diff) | |
download | cgit-7358f63015a27d1c22816a3c1f734c3d4beed115.tar.gz cgit-7358f63015a27d1c22816a3c1f734c3d4beed115.zip |
git: update for v2.3.0
* sort_string_list(): rename to string_list_sort() (upstream commit 3383e199) * update read_tree_recursive callback to pass strbuf as base (upstream commit 6a0b0b6d) Signed-off-by: Christian Hesse <mail@eworm.de>
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | cgit.c | 2 | ||||
m--------- | git | 0 | ||||
-rw-r--r-- | ui-blob.c | 8 | ||||
-rw-r--r-- | ui-plain.c | 13 | ||||
-rw-r--r-- | ui-tree.c | 17 |
6 files changed, 19 insertions, 23 deletions
diff --git a/Makefile b/Makefile index 2ff8a90..3697795 100644 --- a/Makefile +++ b/Makefile | |||
@@ -14,7 +14,7 @@ htmldir = $(docdir) | |||
14 | pdfdir = $(docdir) | 14 | pdfdir = $(docdir) |
15 | mandir = $(prefix)/share/man | 15 | mandir = $(prefix)/share/man |
16 | SHA1_HEADER = <openssl/sha.h> | 16 | SHA1_HEADER = <openssl/sha.h> |
17 | GIT_VER = 2.2.2 | 17 | GIT_VER = 2.3.0 |
18 | GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.gz | 18 | GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.gz |
19 | INSTALL = install | 19 | INSTALL = install |
20 | COPYTREE = cp -r | 20 | COPYTREE = cp -r |
diff --git a/cgit.c b/cgit.c index 431e325..02dddda 100644 --- a/cgit.c +++ b/cgit.c | |||
@@ -603,7 +603,7 @@ static int prepare_repo_cmd(void) | |||
603 | free(tmp); | 603 | free(tmp); |
604 | return 1; | 604 | return 1; |
605 | } | 605 | } |
606 | sort_string_list(&ctx.repo->submodules); | 606 | string_list_sort(&ctx.repo->submodules); |
607 | cgit_prepare_repo_env(ctx.repo); | 607 | cgit_prepare_repo_env(ctx.repo); |
608 | choose_readme(ctx.repo); | 608 | choose_readme(ctx.repo); |
609 | return 0; | 609 | return 0; |
diff --git a/git b/git | |||
Subproject fdf96a20acf96a6ac538df8113b2aafd6ed71d5 | Subproject 9874fca7122563e28d699a911404fc49d2a24f1 | ||
diff --git a/ui-blob.c b/ui-blob.c index c2de8d6..a025bca 100644 --- a/ui-blob.c +++ b/ui-blob.c | |||
@@ -18,15 +18,15 @@ struct walk_tree_context { | |||
18 | int file_only:1; | 18 | int file_only:1; |
19 | }; | 19 | }; |
20 | 20 | ||
21 | static int walk_tree(const unsigned char *sha1, const char *base, int baselen, | 21 | static int walk_tree(const unsigned char *sha1, struct strbuf *base, |
22 | const char *pathname, unsigned mode, int stage, void *cbdata) | 22 | const char *pathname, unsigned mode, int stage, void *cbdata) |
23 | { | 23 | { |
24 | struct walk_tree_context *walk_tree_ctx = cbdata; | 24 | struct walk_tree_context *walk_tree_ctx = cbdata; |
25 | 25 | ||
26 | if (walk_tree_ctx->file_only && !S_ISREG(mode)) | 26 | if (walk_tree_ctx->file_only && !S_ISREG(mode)) |
27 | return READ_TREE_RECURSIVE; | 27 | return READ_TREE_RECURSIVE; |
28 | if (strncmp(base, walk_tree_ctx->match_path, baselen) | 28 | if (strncmp(base->buf, walk_tree_ctx->match_path, base->len) |
29 | || strcmp(walk_tree_ctx->match_path + baselen, pathname)) | 29 | || strcmp(walk_tree_ctx->match_path + base->len, pathname)) |
30 | return READ_TREE_RECURSIVE; | 30 | return READ_TREE_RECURSIVE; |
31 | memmove(walk_tree_ctx->matched_sha1, sha1, 20); | 31 | memmove(walk_tree_ctx->matched_sha1, sha1, 20); |
32 | walk_tree_ctx->found_path = 1; | 32 | walk_tree_ctx->found_path = 1; |
diff --git a/ui-plain.c b/ui-plain.c index 30fff89..b787bc3 100644 --- a/ui-plain.c +++ b/ui-plain.c | |||
@@ -173,23 +173,22 @@ static void print_dir_tail(void) | |||
173 | html(" </ul>\n</body></html>\n"); | 173 | html(" </ul>\n</body></html>\n"); |
174 | } | 174 | } |
175 | 175 | ||
176 | static int walk_tree(const unsigned char *sha1, const char *base, int baselen, | 176 | static int walk_tree(const unsigned char *sha1, struct strbuf *base, |
177 | const char *pathname, unsigned mode, int stage, | 177 | const char *pathname, unsigned mode, int stage, void *cbdata) |
178 | void *cbdata) | ||
179 | { | 178 | { |
180 | struct walk_tree_context *walk_tree_ctx = cbdata; | 179 | struct walk_tree_context *walk_tree_ctx = cbdata; |
181 | 180 | ||
182 | if (baselen == walk_tree_ctx->match_baselen) { | 181 | if (base->len == walk_tree_ctx->match_baselen) { |
183 | if (S_ISREG(mode)) { | 182 | if (S_ISREG(mode)) { |
184 | if (print_object(sha1, pathname)) | 183 | if (print_object(sha1, pathname)) |
185 | walk_tree_ctx->match = 1; | 184 | walk_tree_ctx->match = 1; |
186 | } else if (S_ISDIR(mode)) { | 185 | } else if (S_ISDIR(mode)) { |
187 | print_dir(sha1, base, baselen, pathname); | 186 | print_dir(sha1, base->buf, base->len, pathname); |
188 | walk_tree_ctx->match = 2; | 187 | walk_tree_ctx->match = 2; |
189 | return READ_TREE_RECURSIVE; | 188 | return READ_TREE_RECURSIVE; |
190 | } | 189 | } |
191 | } else if (baselen > walk_tree_ctx->match_baselen) { | 190 | } else if (base->len > walk_tree_ctx->match_baselen) { |
192 | print_dir_entry(sha1, base, baselen, pathname, mode); | 191 | print_dir_entry(sha1, base->buf, base->len, pathname, mode); |
193 | walk_tree_ctx->match = 2; | 192 | walk_tree_ctx->match = 2; |
194 | } else if (S_ISDIR(mode)) { | 193 | } else if (S_ISDIR(mode)) { |
195 | return READ_TREE_RECURSIVE; | 194 | return READ_TREE_RECURSIVE; |
diff --git a/ui-tree.c b/ui-tree.c index e4c3d22..4ab0137 100644 --- a/ui-tree.c +++ b/ui-tree.c | |||
@@ -121,9 +121,8 @@ static void print_object(const unsigned char *sha1, char *path, const char *base | |||
121 | } | 121 | } |
122 | 122 | ||
123 | 123 | ||
124 | static int ls_item(const unsigned char *sha1, const char *base, int baselen, | 124 | static int ls_item(const unsigned char *sha1, struct strbuf *base, |
125 | const char *pathname, unsigned int mode, int stage, | 125 | const char *pathname, unsigned mode, int stage, void *cbdata) |
126 | void *cbdata) | ||
127 | { | 126 | { |
128 | struct walk_tree_context *walk_tree_ctx = cbdata; | 127 | struct walk_tree_context *walk_tree_ctx = cbdata; |
129 | char *name; | 128 | char *name; |
@@ -216,16 +215,15 @@ static void ls_tree(const unsigned char *sha1, char *path, struct walk_tree_cont | |||
216 | } | 215 | } |
217 | 216 | ||
218 | 217 | ||
219 | static int walk_tree(const unsigned char *sha1, const char *base, int baselen, | 218 | static int walk_tree(const unsigned char *sha1, struct strbuf *base, |
220 | const char *pathname, unsigned mode, int stage, | 219 | const char *pathname, unsigned mode, int stage, void *cbdata) |
221 | void *cbdata) | ||
222 | { | 220 | { |
223 | struct walk_tree_context *walk_tree_ctx = cbdata; | 221 | struct walk_tree_context *walk_tree_ctx = cbdata; |
224 | static char buffer[PATH_MAX]; | 222 | static char buffer[PATH_MAX]; |
225 | 223 | ||
226 | if (walk_tree_ctx->state == 0) { | 224 | if (walk_tree_ctx->state == 0) { |
227 | memcpy(buffer, base, baselen); | 225 | memcpy(buffer, base->buf, base->len); |
228 | strcpy(buffer + baselen, pathname); | 226 | strcpy(buffer + base->len, pathname); |
229 | if (strcmp(walk_tree_ctx->match_path, buffer)) | 227 | if (strcmp(walk_tree_ctx->match_path, buffer)) |
230 | return READ_TREE_RECURSIVE; | 228 | return READ_TREE_RECURSIVE; |
231 | 229 | ||
@@ -238,11 +236,10 @@ static int walk_tree(const unsigned char *sha1, const char *base, int baselen, | |||
238 | return 0; | 236 | return 0; |
239 | } | 237 | } |
240 | } | 238 | } |
241 | ls_item(sha1, base, baselen, pathname, mode, stage, walk_tree_ctx); | 239 | ls_item(sha1, base, pathname, mode, stage, walk_tree_ctx); |
242 | return 0; | 240 | return 0; |
243 | } | 241 | } |
244 | 242 | ||
245 | |||
246 | /* | 243 | /* |
247 | * Show a tree or a blob | 244 | * Show a tree or a blob |
248 | * rev: the commit pointing at the root tree object | 245 | * rev: the commit pointing at the root tree object |