aboutsummaryrefslogtreecommitdiffstats
path: root/shared.c
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2018-03-22 11:32:53 +0100
committerFlorian Pritz <bluewind@xinu.at>2018-03-22 11:32:53 +0100
commit343a8b8ee33f9a181e662fc0e3a3979dd9b52dd4 (patch)
tree2be5d6faa22089f8d1b0c1d7e14f283550130370 /shared.c
parente4803632f41cc3f09af6a88511b1d6359be3d325 (diff)
parent33414d7869aa55aaccd45cdb82268d454cb79863 (diff)
downloadcgit-343a8b8ee33f9a181e662fc0e3a3979dd9b52dd4.tar.gz
cgit-343a8b8ee33f9a181e662fc0e3a3979dd9b52dd4.tar.xz
Merge branch 'master' of https://git.zx2c4.com/cgit into local
Diffstat (limited to 'shared.c')
-rw-r--r--shared.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/shared.c b/shared.c
index c63f1e3..21ac8f4 100644
--- a/shared.c
+++ b/shared.c
@@ -160,7 +160,7 @@ static struct refinfo *cgit_mk_refinfo(const char *refname, const struct object_
ref = xmalloc(sizeof (struct refinfo));
ref->refname = xstrdup(refname);
- ref->object = parse_object(oid->hash);
+ ref->object = parse_object(oid);
switch (ref->object->type) {
case OBJ_TAG:
ref->tag = cgit_parse_tag((struct tag *)ref->object);
@@ -346,13 +346,13 @@ void cgit_diff_tree(const struct object_id *old_oid,
opt.output_format = DIFF_FORMAT_CALLBACK;
opt.detect_rename = 1;
opt.rename_limit = ctx.cfg.renamelimit;
- DIFF_OPT_SET(&opt, RECURSIVE);
+ opt.flags.recursive = 1;
if (ignorews)
DIFF_XDL_SET(&opt, IGNORE_WHITESPACE);
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;
@@ -360,11 +360,13 @@ void cgit_diff_tree(const struct object_id *old_oid,
diff_setup_done(&opt);
if (old_oid && !is_null_oid(old_oid))
- diff_tree_sha1(old_oid->hash, new_oid->hash, "", &opt);
+ diff_tree_oid(old_oid, new_oid, "", &opt);
else
- diff_root_tree_sha1(new_oid->hash, "", &opt);
+ diff_root_tree_oid(new_oid, "", &opt);
diffcore_std(&opt);
diff_flush(&opt);
+
+ free(item.match);
}
void cgit_diff_commit(struct commit *commit, filepair_fn fn, const char *prefix)