aboutsummaryrefslogtreecommitdiffstats
path: root/shared.c
diff options
context:
space:
mode:
authorChristian Hesse2017-07-24 17:22:52 +0200
committerLukas Fleischer2017-08-10 15:15:54 +0200
commit3d33b46df24d4dee140d0aafb1eba5fffa314cf0 (patch)
tree86086c5ca8dfe17322ced822e7c313fd09337824 /shared.c
parent7ce19ba550ff0d32359b9fb35eeb6282747524b9 (diff)
downloadcgit-3d33b46df24d4dee140d0aafb1eba5fffa314cf0.tar.gz
cgit-3d33b46df24d4dee140d0aafb1eba5fffa314cf0.tar.bz2
cgit-3d33b46df24d4dee140d0aafb1eba5fffa314cf0.zip
git: update to v2.13.4
Update to git version v2.13.4: With commit 8aee769f (pathspec: copy and free owned memory) the definition of struct pathspec_item has changed with the expectation that pathspecs will be managed dynamically. We work around this a bit by setting up a static structure, but let's allocate the match string to avoid needing to cast away const. Updated a patch from John Keeping <john@keeping.me.uk> for git v2.12.1.
Diffstat (limited to 'shared.c')
-rw-r--r--shared.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/shared.c b/shared.c
index c63f1e3..13a65a9 100644
--- a/shared.c
+++ b/shared.c
@@ -352,7 +352,7 @@ void cgit_diff_tree(const struct object_id *old_oid,
352 opt.format_callback = cgit_diff_tree_cb; 352 opt.format_callback = cgit_diff_tree_cb;
353 opt.format_callback_data = fn; 353 opt.format_callback_data = fn;
354 if (prefix) { 354 if (prefix) {
355 item.match = prefix; 355 item.match = xstrdup(prefix);
356 item.len = strlen(prefix); 356 item.len = strlen(prefix);
357 opt.pathspec.nr = 1; 357 opt.pathspec.nr = 1;
358 opt.pathspec.items = &item; 358 opt.pathspec.items = &item;
@@ -365,6 +365,8 @@ void cgit_diff_tree(const struct object_id *old_oid,
365 diff_root_tree_sha1(new_oid->hash, "", &opt); 365 diff_root_tree_sha1(new_oid->hash, "", &opt);
366 diffcore_std(&opt); 366 diffcore_std(&opt);
367 diff_flush(&opt); 367 diff_flush(&opt);
368
369 free(item.match);
368} 370}
369 371
370void cgit_diff_commit(struct commit *commit, filepair_fn fn, const char *prefix) 372void cgit_diff_commit(struct commit *commit, filepair_fn fn, const char *prefix)