threads / patch / 44997

patchcheckout: convert post_checkout_hook() to struct object_id

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

## tl;dr

3 messages between Jan 28, 2017 and Jan 30, 2017. Diffs are folded; open one to read it.

replies: 2people: 3as markdown or json

René Scharfe· Jan 28, 2017, 22:14 UTC · lore
Signed-off-by: Rene Scharfe <l.s.r@web.de>
---
 builtin/checkout.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Show changes to builtin/checkout.c +2 −2
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
Johannes Schindelin· Jan 30, 2017, 13:01 UTC · re: René Scharfe · lore

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

Hi René,
On Sat, 28 Jan 2017, René Scharfe wrote:
> Signed-off-by: Rene Scharfe <l.s.r@web.de>
These three SHA-1 -> OID patches all appear correct to me.

Ciao, Dscho

brian m. carlson· Jan 30, 2017, 22:48 UTC · re: Johannes Schindelin · lore

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

On Mon, Jan 30, 2017 at 02:01:12PM +0100, Johannes Schindelin wrote:
Show 7 quoted lines
> Hi René,
> 
> On Sat, 28 Jan 2017, René Scharfe wrote:
> 
> > Signed-off-by: Rene Scharfe <l.s.r@web.de>
> 
> 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

← back to recent threads