author | Lars Hjemli <hjemli@gmail.com> | 2008-01-13 18:16:23 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2008-01-21 07:52:09 (UTC) |
commit | 776200b1c10536174f68fc6599fc709ae620db54 (patch) (side-by-side diff) | |
tree | d5b24090675c5ac7b0ca29459d3246dcb0d7c8af /shared.c | |
parent | 2122c696a34133a616b9ec6d72abe9eb89e728aa (diff) | |
download | cgit-776200b1c10536174f68fc6599fc709ae620db54.zip cgit-776200b1c10536174f68fc6599fc709ae620db54.tar.gz cgit-776200b1c10536174f68fc6599fc709ae620db54.tar.bz2 |
Use GIT-1.5.4.rc4
-rw-r--r-- | shared.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -463,59 +463,59 @@ int cgit_diff_files(const unsigned char *old_sha1, linediff_fn fn) { mmfile_t file1, file2; xpparam_t diff_params; xdemitconf_t emit_params; xdemitcb_t emit_cb; if (!load_mmfile(&file1, old_sha1) || !load_mmfile(&file2, new_sha1)) return 1; diff_params.flags = XDF_NEED_MINIMAL; emit_params.ctxlen = 3; emit_params.flags = XDL_EMIT_FUNCNAMES; emit_params.find_func = NULL; emit_cb.outf = filediff_cb; emit_cb.priv = fn; xdl_diff(&file1, &file2, &diff_params, &emit_params, &emit_cb); return 0; } void cgit_diff_tree(const unsigned char *old_sha1, const unsigned char *new_sha1, filepair_fn fn, const char *prefix) { struct diff_options opt; int ret; int prefixlen; diff_setup(&opt); opt.output_format = DIFF_FORMAT_CALLBACK; opt.detect_rename = 1; opt.rename_limit = cgit_renamelimit; - opt.recursive = 1; + DIFF_OPT_SET(&opt, RECURSIVE); opt.format_callback = cgit_diff_tree_cb; opt.format_callback_data = fn; if (prefix) { opt.nr_paths = 1; opt.paths = &prefix; prefixlen = strlen(prefix); opt.pathlens = &prefixlen; } diff_setup_done(&opt); if (old_sha1 && !is_null_sha1(old_sha1)) ret = diff_tree_sha1(old_sha1, new_sha1, "", &opt); else ret = diff_root_tree_sha1(new_sha1, "", &opt); diffcore_std(&opt); diff_flush(&opt); } void cgit_diff_commit(struct commit *commit, filepair_fn fn) { unsigned char *old_sha1 = NULL; if (commit->parents) old_sha1 = commit->parents->item->object.sha1; cgit_diff_tree(old_sha1, commit->object.sha1, fn, NULL); } |