summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
bb02e24)
Since git commit
244c27242f44e6b88e3a381c90bde08d134c274b,
> diff.[ch]: have diff_free() call clear_pathspec(opts.pathspec)
calling diff_flush calls free(3) on opts.pathspec.items, so it can't
be a pointer to a stack variable.
Signed-off-by: Christian Hesse <mail@eworm.de>
filepair_fn fn, const char *prefix, int ignorews)
{
struct diff_options opt;
filepair_fn fn, const char *prefix, int ignorews)
{
struct diff_options opt;
- struct pathspec_item item;
+ struct pathspec_item *item;
- memset(&item, 0, sizeof(item));
diff_setup(&opt);
opt.output_format = DIFF_FORMAT_CALLBACK;
opt.detect_rename = 1;
diff_setup(&opt);
opt.output_format = DIFF_FORMAT_CALLBACK;
opt.detect_rename = 1;
opt.format_callback = cgit_diff_tree_cb;
opt.format_callback_data = fn;
if (prefix) {
opt.format_callback = cgit_diff_tree_cb;
opt.format_callback_data = fn;
if (prefix) {
- item.match = xstrdup(prefix);
- item.len = strlen(prefix);
+ item = xcalloc(1, sizeof(*item));
+ item->match = xstrdup(prefix);
+ item->len = strlen(prefix);
- opt.pathspec.items = &item;
+ opt.pathspec.items = item;
diff_root_tree_oid(new_oid, "", &opt);
diffcore_std(&opt);
diff_flush(&opt);
diff_root_tree_oid(new_oid, "", &opt);
diffcore_std(&opt);
diff_flush(&opt);
}
void cgit_diff_commit(struct commit *commit, filepair_fn fn, const char *prefix)
}
void cgit_diff_commit(struct commit *commit, filepair_fn fn, const char *prefix)