From 3d33b46df24d4dee140d0aafb1eba5fffa314cf0 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 24 Jul 2017 17:22:52 +0200 Subject: 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 for git v2.12.1. --- shared.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'shared.c') 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, opt.format_callback = cgit_diff_tree_cb; opt.format_callback_data = fn; if (prefix) { - item.match = prefix; + item.match = xstrdup(prefix); item.len = strlen(prefix); opt.pathspec.nr = 1; opt.pathspec.items = &item; @@ -365,6 +365,8 @@ void cgit_diff_tree(const struct object_id *old_oid, diff_root_tree_sha1(new_oid->hash, "", &opt); diffcore_std(&opt); diff_flush(&opt); + + free(item.match); } void cgit_diff_commit(struct commit *commit, filepair_fn fn, const char *prefix) -- cgit v1.2.3-56-ge451