[PATCH] checkout: convert post_checkout_hook() to struct object_id

Subsystems: the rest

STALE3473d

3 messages, 3 authors, 2017-01-30 · open the first message on its own page

[PATCH] checkout: convert post_checkout_hook() to struct object_id

From: René Scharfe <hidden>
Date: 2017-01-28 22:16:19

Signed-off-by: Rene Scharfe <redacted>
---
 builtin/checkout.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/builtin/checkout.c b/builtin/checkout.c
index bfe685c198..80d5e38981 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. */
-- 
2.11.0

Re: [PATCH] checkout: convert post_checkout_hook() to struct object_id

From: Johannes Schindelin <hidden>
Date: 2017-01-30 13:03:04

Hi René,

On Sat, 28 Jan 2017, René Scharfe wrote:
Signed-off-by: Rene Scharfe <redacted>
These three SHA-1 -> OID patches all appear correct to me.

Ciao,
Dscho

Re: [PATCH] checkout: convert post_checkout_hook() to struct object_id

From: brian m. carlson <hidden>
Date: 2017-01-30 22:48:42

On Mon, Jan 30, 2017 at 02:01:12PM +0100, Johannes Schindelin wrote:
Hi René,

On Sat, 28 Jan 2017, René Scharfe wrote:
quoted
Signed-off-by: Rene Scharfe <redacted>
These three SHA-1 -> OID patches all appear correct to me.
I concur.  These look good.
-- 
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help