Merge branch 'sg/diff-indent-heuristic-non-experimental'
[gitweb.git] / line-log.c
index 24e21731c4315f414578b33178a7b784176bb24d..3aff1849e7d5c7dba5c14b2fa34f7af64064a42d 100644 (file)
@@ -496,12 +496,13 @@ static struct commit *check_single_commit(struct rev_info *revs)
        return (struct commit *) commit;
 }
 
-static void fill_blob_sha1(struct commit *commit, struct diff_filespec *spec)
+static void fill_blob_sha1(struct repository *r, struct commit *commit,
+                          struct diff_filespec *spec)
 {
-       unsigned mode;
+       unsigned short mode;
        struct object_id oid;
 
-       if (get_tree_entry(&commit->object.oid, spec->path, &oid, &mode))
+       if (get_tree_entry(r, &commit->object.oid, spec->path, &oid, &mode))
                die("There is no path %s in the commit", spec->path);
        fill_filespec(spec, &oid, 1, mode);
 
@@ -585,7 +586,7 @@ parse_lines(struct repository *r, struct commit *commit,
                                        name_part);
 
                spec = alloc_filespec(full_name);
-               fill_blob_sha1(commit, spec);
+               fill_blob_sha1(r, commit, spec);
                fill_line_ends(r, spec, &lines, &ends);
                cb_data.spec = spec;
                cb_data.lines = lines;
@@ -1103,10 +1104,12 @@ static int process_all_files(struct line_log_data **range_out,
 
 int line_log_print(struct rev_info *rev, struct commit *commit)
 {
-       struct line_log_data *range = lookup_line_range(rev, commit);
 
        show_log(rev);
-       dump_diff_hacky(rev, range);
+       if (!(rev->diffopt.output_format & DIFF_FORMAT_NO_OUTPUT)) {
+               struct line_log_data *range = lookup_line_range(rev, commit);
+               dump_diff_hacky(rev, range);
+       }
        return 1;
 }