mingw: skip test in t1508 that fails due to path conversion
[gitweb.git] / line-log.c
index c12c69f05ab478cd35208eed4fdc6697977b86de..af6e2f799ec7e2447ee888854442a7cbfe7644e4 100644 (file)
@@ -325,7 +325,7 @@ static int collect_diff_cb(long start_a, long count_a,
        return 0;
 }
 
-static void collect_diff(mmfile_t *parent, mmfile_t *target, struct diff_ranges *out)
+static int collect_diff(mmfile_t *parent, mmfile_t *target, struct diff_ranges *out)
 {
        struct collect_diff_cbdata cbdata = {NULL};
        xpparam_t xpp;
@@ -340,7 +340,7 @@ static void collect_diff(mmfile_t *parent, mmfile_t *target, struct diff_ranges
        xecfg.hunk_func = collect_diff_cb;
        memset(&ecb, 0, sizeof(ecb));
        ecb.priv = &cbdata;
-       xdi_diff(parent, target, &xpp, &xecfg, &ecb);
+       return xdi_diff(parent, target, &xpp, &xecfg, &ecb);
 }
 
 /*
@@ -502,7 +502,7 @@ static void fill_blob_sha1(struct commit *commit, struct diff_filespec *spec)
        unsigned mode;
        unsigned char sha1[20];
 
-       if (get_tree_entry(commit->object.sha1, spec->path,
+       if (get_tree_entry(commit->object.oid.hash, spec->path,
                           sha1, &mode))
                die("There is no path %s in the commit", spec->path);
        fill_filespec(spec, sha1, 1, mode);
@@ -824,8 +824,8 @@ static void queue_diffs(struct line_log_data *range,
        assert(commit);
 
        DIFF_QUEUE_CLEAR(&diff_queued_diff);
-       diff_tree_sha1(parent ? parent->tree->object.sha1 : NULL,
-                       commit->tree->object.sha1, "", opt);
+       diff_tree_sha1(parent ? parent->tree->object.oid.hash : NULL,
+                       commit->tree->object.oid.hash, "", opt);
        if (opt->detect_rename) {
                filter_diffs_for_paths(range, 1);
                if (diff_might_be_rename())
@@ -1030,7 +1030,8 @@ static int process_diff_filepair(struct rev_info *rev,
        }
 
        diff_ranges_init(&diff);
-       collect_diff(&file_parent, &file_target, &diff);
+       if (collect_diff(&file_parent, &file_target, &diff))
+               die("unable to generate diff for %s", pair->one->path);
 
        /* NEEDSWORK should apply some heuristics to prevent mismatches */
        free(rg->path);