Skip to contentSkip to conversation

checkout: convert post_checkout_hook() to struct object_id

PATCH In review René Scharfe 3 participants 3 messages Jan 28, 2017 – Jan 30, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 checkout: convert post_checkout_hook() to struct object_id

---
 builtin/checkout.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
builtin/checkout.c +2 -2
index bfe685c198..80d5e38981 100644
@@ -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. */
Signature · 1 line
2.11.0
#2 lore raw
Quoted 7 lines · Johannes Schindelin

Hi René,

Quoted 1 line · René Scharfe

These three SHA-1 -> OID patches all appear correct to me.

I concur. These look good.

Signature · 3 lines
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | https://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: https://keybase.io/bk2204