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

3 messages from 2017-01-28 to 2017-01-30. Participants: René Scharfe, Johannes Schindelin, brian m. carlson.
Thread: https://gitlist.dev/t/44997

## René Scharfe, 2017-01-28 22:14

Subject: [PATCH] checkout: convert post_checkout_hook() to struct object_id
Message-ID: <b30e5d34-436a-af5f-dbad-b1df464bf303@web.de>
URL: https://gitlist.dev/e/b30e5d34-436a-af5f-dbad-b1df464bf303%40web.de

```
Signed-off-by: Rene Scharfe <l.s.r@web.de>
---
 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


```

## Johannes Schindelin, 2017-01-30 13:01

Subject: Re: [PATCH] checkout: convert post_checkout_hook() to struct object_id
Message-ID: <alpine.DEB.2.20.1701301359500.3469@virtualbox>
URL: https://gitlist.dev/e/alpine.DEB.2.20.1701301359500.3469%40virtualbox
In-Reply-To: <b30e5d34-436a-af5f-dbad-b1df464bf303@web.de>

```
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, 2017-01-30 22:48

Subject: Re: [PATCH] checkout: convert post_checkout_hook() to struct object_id
Message-ID: <20170130224822.uehscfwrgav5r6pc@genre.crustytoothpaste.net>
URL: https://gitlist.dev/e/20170130224822.uehscfwrgav5r6pc%40genre.crustytoothpaste.net
In-Reply-To: <alpine.DEB.2.20.1701301359500.3469@virtualbox>

```
On Mon, Jan 30, 2017 at 02:01:12PM +0100, Johannes Schindelin wrote:
> 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

```
