Merge branch 'sb/histogram-less-memory'
[gitweb.git] / line-log.c
index ecdce08c4be24cc14109796d9a7c165c53753a88..72a5fed661ca0a0f0eb1fe726e91acc8cd47512a 100644 (file)
@@ -479,7 +479,7 @@ static struct commit *check_single_commit(struct rev_info *revs)
                struct object *obj = revs->pending.objects[i].item;
                if (obj->flags & UNINTERESTING)
                        continue;
-               obj = deref_tag(obj, NULL, 0);
+               obj = deref_tag(the_repository, obj, NULL, 0);
                if (obj->type != OBJ_COMMIT)
                        die("Non commit %s?", revs->pending.objects[i].name);
                if (commit)
@@ -598,11 +598,11 @@ parse_lines(struct commit *commit, const char *prefix, struct string_list *args)
                                    lines, anchor, &begin, &end,
                                    full_name))
                        die("malformed -L argument '%s'", range_part);
-               if (lines < end || ((lines || begin) && lines < begin))
+               if ((!lines && (begin || end)) || lines < begin)
                        die("file %s has only %lu lines", name_part, lines);
                if (begin < 1)
                        begin = 1;
-               if (end < 1)
+               if (end < 1 || lines < end)
                        end = lines;
                begin--;
                line_log_data_insert(&ranges, full_name, begin, end);
@@ -816,8 +816,8 @@ static void queue_diffs(struct line_log_data *range,
        assert(commit);
 
        DIFF_QUEUE_CLEAR(&diff_queued_diff);
-       diff_tree_oid(parent ? &parent->tree->object.oid : NULL,
-                     &commit->tree->object.oid, "", opt);
+       diff_tree_oid(parent ? get_commit_tree_oid(parent) : NULL,
+                     get_commit_tree_oid(commit), "", opt);
        if (opt->detect_rename) {
                filter_diffs_for_paths(range, 1);
                if (diff_might_be_rename())