use oid_to_hex_r() for converting struct object_id hashes to hex strings
Patch generated by Coccinelle and contrib/coccinelle/object_id.cocci. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
René Scharfe committed
Jan 28, 2017 at 23:03 UTC
2490574d15cab6e8d955dc4132cf9e7e83fc1172
4 files changed
+5
-5
builtin/blame.c
+2
-2
@@ -1901,7 +1901,7 @@ static void emit_porcelain(struct scoreboard *sb, struct blame_entry *ent,
1901
struct origin *suspect = ent->suspect;
1902
char hex[GIT_SHA1_HEXSZ + 1];
1903
1904
- sha1_to_hex_r(hex, suspect->commit->object.oid.hash);
1904
+ oid_to_hex_r(hex, &suspect->commit->object.oid);
1905
printf("%s %d %d %d\n",
1906
hex,
1907
ent->s_lno + 1,
@@ -1941,7 +1941,7 @@ static void emit_other(struct scoreboard *sb, struct blame_entry *ent, int opt)
1941
int show_raw_time = !!(opt & OUTPUT_RAW_TIMESTAMP);
1942
1943
get_commit_info(suspect->commit, &ci, 1);
1944
- sha1_to_hex_r(hex, suspect->commit->object.oid.hash);
1944
+ oid_to_hex_r(hex, &suspect->commit->object.oid);
1945
1946
cp = nth_line(sb, ent->lno);
1947
for (cnt = 0; cnt < ent->num_lines; cnt++) {
builtin/merge-index.c
+1
-1
@@ -22,7 +22,7 @@ static int merge_entry(int pos, const char *path)
22
if (strcmp(ce->name, path))
23
break;
24
found++;
25
- sha1_to_hex_r(hexbuf[stage], ce->oid.hash);
25
+ oid_to_hex_r(hexbuf[stage], &ce->oid);
26
xsnprintf(ownbuf[stage], sizeof(ownbuf[stage]), "%o", ce->ce_mode);
27
arguments[stage] = hexbuf[stage];
28
arguments[stage + 4] = ownbuf[stage];
builtin/rev-list.c
+1
-1
@@ -237,7 +237,7 @@ static int show_bisect_vars(struct rev_list_info *info, int reaches, int all)
237
cnt = reaches;
238
239
if (revs->commits)
240
- sha1_to_hex_r(hex, revs->commits->item->object.oid.hash);
240
+ oid_to_hex_r(hex, &revs->commits->item->object.oid);
241
242
if (flags & BISECT_SHOW_ALL) {
243
traverse_commit_list(revs, show_commit, show_object, info);
diff.c
+1
-1
@@ -3015,7 +3015,7 @@ static struct diff_tempfile *prepare_temp_file(const char *name,
3015
if (!one->oid_valid)
3016
sha1_to_hex_r(temp->hex, null_sha1);
3017
else
3018
- sha1_to_hex_r(temp->hex, one->oid.hash);
3018
+ oid_to_hex_r(temp->hex, &one->oid);
3019
/* Even though we may sometimes borrow the
3020
* contents from the work tree, we always want
3021
* one->mode. mode is trustworthy even when