diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-02-03 19:25:19 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-02-03 19:25:19 (GMT) |
commit | 36acf41239a7406d52faf1b6c757ffe34e3be98d (patch) | |
tree | 47d07010f6c7c0fa066105f034759398dc767993 /builtin | |
parent | ecc486b1f8ad5962ed51bcbffbba75ff2bc633ad (diff) | |
parent | 0ce11fe951e3a1ba73b940563a4227cf45461489 (diff) | |
download | git-36acf41239a7406d52faf1b6c757ffe34e3be98d.zip git-36acf41239a7406d52faf1b6c757ffe34e3be98d.tar.gz git-36acf41239a7406d52faf1b6c757ffe34e3be98d.tar.bz2 |
Merge branch 'rs/object-id'
"uchar [40]" to "struct object_id" conversion continues.
* rs/object-id:
checkout: convert post_checkout_hook() to struct object_id
use oidcpy() for copying hashes between instances of struct object_id
use oid_to_hex_r() for converting struct object_id hashes to hex strings
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/blame.c | 4 | ||||
-rw-r--r-- | builtin/checkout.c | 4 | ||||
-rw-r--r-- | builtin/merge-index.c | 2 | ||||
-rw-r--r-- | builtin/rev-list.c | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/builtin/blame.c b/builtin/blame.c index 126b8c9..cffc626 100644 --- a/builtin/blame.c +++ b/builtin/blame.c @@ -1901,7 +1901,7 @@ static void emit_porcelain(struct scoreboard *sb, struct blame_entry *ent, struct origin *suspect = ent->suspect; char hex[GIT_SHA1_HEXSZ + 1]; - sha1_to_hex_r(hex, suspect->commit->object.oid.hash); + oid_to_hex_r(hex, &suspect->commit->object.oid); printf("%s %d %d %d\n", hex, ent->s_lno + 1, @@ -1941,7 +1941,7 @@ static void emit_other(struct scoreboard *sb, struct blame_entry *ent, int opt) int show_raw_time = !!(opt & OUTPUT_RAW_TIMESTAMP); get_commit_info(suspect->commit, &ci, 1); - sha1_to_hex_r(hex, suspect->commit->object.oid.hash); + oid_to_hex_r(hex, &suspect->commit->object.oid); cp = nth_line(sb, ent->lno); for (cnt = 0; cnt < ent->num_lines; cnt++) { diff --git a/builtin/checkout.c b/builtin/checkout.c index bfe685c..80d5e38 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -56,8 +56,8 @@ static int post_checkout_hook(struct commit *old, struct commit *new, int changed) { return run_hook_le(NULL, "post-checkout", - sha1_to_hex(old ? old->object.oid.hash : null_sha1), - sha1_to_hex(new ? new->object.oid.hash : null_sha1), + oid_to_hex(old ? &old->object.oid : &null_oid), + oid_to_hex(new ? &new->object.oid : &null_oid), changed ? "1" : "0", NULL); /* "new" can be NULL when checking out from the index before a commit exists. */ diff --git a/builtin/merge-index.c b/builtin/merge-index.c index ce356b1..2d1b6db 100644 --- a/builtin/merge-index.c +++ b/builtin/merge-index.c @@ -22,7 +22,7 @@ static int merge_entry(int pos, const char *path) if (strcmp(ce->name, path)) break; found++; - sha1_to_hex_r(hexbuf[stage], ce->oid.hash); + oid_to_hex_r(hexbuf[stage], &ce->oid); xsnprintf(ownbuf[stage], sizeof(ownbuf[stage]), "%o", ce->ce_mode); arguments[stage] = hexbuf[stage]; arguments[stage + 4] = ownbuf[stage]; diff --git a/builtin/rev-list.c b/builtin/rev-list.c index c43decd..0aa93d5 100644 --- a/builtin/rev-list.c +++ b/builtin/rev-list.c @@ -237,7 +237,7 @@ static int show_bisect_vars(struct rev_list_info *info, int reaches, int all) cnt = reaches; if (revs->commits) - sha1_to_hex_r(hex, revs->commits->item->object.oid.hash); + oid_to_hex_r(hex, &revs->commits->item->object.oid); if (flags & BISECT_SHOW_ALL) { traverse_commit_list(revs, show_commit, show_object, info); |