sequencer: lib'ify read_populate_todo()
[gitweb.git] / line-log.c
index e62a7f4ac4102556cc49bbec76b9a0e737efea77..916e7248701dad2a8beb870887a5ed7d3874ff41 100644 (file)
@@ -480,8 +480,7 @@ static struct commit *check_single_commit(struct rev_info *revs)
                struct object *obj = revs->pending.objects[i].item;
                if (obj->flags & UNINTERESTING)
                        continue;
-               while (obj->type == OBJ_TAG)
-                       obj = deref_tag(obj, NULL, 0);
+               obj = deref_tag(obj, NULL, 0);
                if (obj->type != OBJ_COMMIT)
                        die("Non commit %s?", revs->pending.objects[i].name);
                if (commit)
@@ -520,7 +519,7 @@ static void fill_line_ends(struct diff_filespec *spec, long *lines,
        char *data = NULL;
 
        if (diff_populate_filespec(spec, 0))
-               die("Cannot read blob %s", sha1_to_hex(spec->sha1));
+               die("Cannot read blob %s", oid_to_hex(&spec->oid));
 
        ALLOC_ARRAY(ends, size);
        ends[cur++] = 0;
@@ -894,14 +893,14 @@ static void dump_diff_hacky_one(struct rev_info *rev, struct line_log_data *rang
        if (!pair || !diff)
                return;
 
-       if (pair->one->sha1_valid)
+       if (pair->one->oid_valid)
                fill_line_ends(pair->one, &p_lines, &p_ends);
        fill_line_ends(pair->two, &t_lines, &t_ends);
 
        fprintf(opt->file, "%s%sdiff --git a/%s b/%s%s\n", prefix, c_meta, pair->one->path, pair->two->path, c_reset);
        fprintf(opt->file, "%s%s--- %s%s%s\n", prefix, c_meta,
-              pair->one->sha1_valid ? "a/" : "",
-              pair->one->sha1_valid ? pair->one->path : "/dev/null",
+              pair->one->oid_valid ? "a/" : "",
+              pair->one->oid_valid ? pair->one->path : "/dev/null",
               c_reset);
        fprintf(opt->file, "%s%s+++ b/%s%s\n", prefix, c_meta, pair->two->path, c_reset);
        for (i = 0; i < range->ranges.nr; i++) {
@@ -1011,12 +1010,12 @@ static int process_diff_filepair(struct rev_info *rev,
        if (rg->ranges.nr == 0)
                return 0;
 
-       assert(pair->two->sha1_valid);
+       assert(pair->two->oid_valid);
        diff_populate_filespec(pair->two, 0);
        file_target.ptr = pair->two->data;
        file_target.size = pair->two->size;
 
-       if (pair->one->sha1_valid) {
+       if (pair->one->oid_valid) {
                diff_populate_filespec(pair->one, 0);
                file_parent.ptr = pair->one->data;
                file_parent.size = pair->one->size;