diff.c: emit_diff_symbol learns about DIFF_SYMBOL_STAT_SEP
[gitweb.git] / line-log.c
index 79eded7363bce69c1d540a66ed3ba2d74310d50f..ab0709f9aecaacdfaf44aa31c88873b4ab5d8278 100644 (file)
@@ -34,9 +34,8 @@ void range_set_init(struct range_set *rs, size_t prealloc)
 
 void range_set_release(struct range_set *rs)
 {
-       free(rs->ranges);
+       FREE_AND_NULL(rs->ranges);
        rs->alloc = rs->nr = 0;
-       rs->ranges = NULL;
 }
 
 /* dst must be uninitialized! */
@@ -500,12 +499,12 @@ static struct commit *check_single_commit(struct rev_info *revs)
 static void fill_blob_sha1(struct commit *commit, struct diff_filespec *spec)
 {
        unsigned mode;
-       unsigned char sha1[20];
+       struct object_id oid;
 
        if (get_tree_entry(commit->object.oid.hash, spec->path,
-                          sha1, &mode))
+                          oid.hash, &mode))
                die("There is no path %s in the commit", spec->path);
-       fill_filespec(spec, sha1, 1, mode);
+       fill_filespec(spec, &oid, 1, mode);
 
        return;
 }
@@ -818,8 +817,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.oid.hash : NULL,
-                       commit->tree->object.oid.hash, "", opt);
+       diff_tree_oid(parent ? &parent->tree->object.oid : NULL,
+                     &commit->tree->object.oid, "", opt);
        if (opt->detect_rename) {
                filter_diffs_for_paths(range, 1);
                if (diff_might_be_rename())