Merge branch 'bc/cocci'
Conversion from unsigned char sha1[20] to struct object_id continues. * bc/cocci: diff: convert prep_temp_blob() to struct object_id merge-recursive: convert merge_recursive_generic() to object_id merge-recursive: convert leaf functions to use struct object_id merge-recursive: convert struct merge_file_info to object_id merge-recursive: convert struct stage_data to use object_id diff: rename struct diff_filespec's sha1_valid member diff: convert struct diff_filespec to struct object_id coccinelle: apply object_id Coccinelle transformations coccinelle: convert hashcpy() with null_sha1 to hashclr() contrib/coccinelle: add basic Coccinelle transforms hex: add oid_to_hex_r()
This commit is contained in:
12
line-log.c
12
line-log.c
@ -519,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;
|
||||
@ -893,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++) {
|
||||
@ -1010,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;
|
||||
|
Reference in New Issue
Block a user