Re: [PATCH] fsck: avoid looking at NULL blob->object

2018-06-12 Thread Jeff King
On Sat, Jun 09, 2018 at 03:44:30PM +0200, Martin Ågren wrote: > On 9 June 2018 at 11:21, Jeff King wrote: > > On Sat, Jun 09, 2018 at 10:50:36AM +0200, Martin Ågren wrote: > > > >> On 9 June 2018 at 10:32, Jeff King wrote: > >> > Except it _does_ do one non-trivial thing, which is call the > >>

Re: [PATCH] fsck: avoid looking at NULL blob->object

2018-06-09 Thread Jeff King
On Sat, Jun 09, 2018 at 10:50:36AM +0200, Martin Ågren wrote: > On 9 June 2018 at 10:32, Jeff King wrote: > > Except it _does_ do one non-trivial thing, which is call the > > report() function, which wants us to pass a pointer to a > > "struct object". Which we don't have (we have only a "struct

Re: [PATCH] fsck: avoid looking at NULL blob->object

2018-06-09 Thread Jeff King
On Sat, Jun 09, 2018 at 10:45:15AM +0200, Duy Nguyen wrote: > > It seems like we could refactor report() to just take the > > object_id itself. But we pass the object pointer along to > > a callback function, and indeed this ends up in > > builtin/fsck.c's objreport() which does want to look at >

Re: [PATCH] fsck: avoid looking at NULL blob->object

2018-06-09 Thread Jeff King
On Sat, Jun 09, 2018 at 04:38:54AM -0400, Eric Sunshine wrote: > On Sat, Jun 9, 2018 at 4:32 AM, Jeff King wrote: > > Commit 159e7b080b (fsck: detect gitmodules files, > > 2018-05-02) taught fsck to look at the content of > > .gitmodules files. If the object turns out not to be a blob > > at

Re: [PATCH] fsck: avoid looking at NULL blob->object

2018-06-09 Thread Martin Ågren
On 9 June 2018 at 10:32, Jeff King wrote: > Except it _does_ do one non-trivial thing, which is call the > report() function, which wants us to pass a pointer to a > "struct object". Which we don't have (we have only a "struct > object_id"). So we erroneously passed the NULL object, which

Re: [PATCH] fsck: avoid looking at NULL blob->object

2018-06-09 Thread Duy Nguyen
On Sat, Jun 9, 2018 at 10:34 AM Jeff King wrote: > > Commit 159e7b080b (fsck: detect gitmodules files, > 2018-05-02) taught fsck to look at the content of > .gitmodules files. If the object turns out not to be a blob > at all, we just complain and punt on checking the content. > And since this

Re: [PATCH] fsck: avoid looking at NULL blob->object

2018-06-09 Thread Eric Sunshine
On Sat, Jun 9, 2018 at 4:32 AM, Jeff King wrote: > Commit 159e7b080b (fsck: detect gitmodules files, > 2018-05-02) taught fsck to look at the content of > .gitmodules files. If the object turns out not to be a blob > at all, we just complain and punt on checking the content. > And since this was

[PATCH] fsck: avoid looking at NULL blob->object

2018-06-09 Thread Jeff King
Commit 159e7b080b (fsck: detect gitmodules files, 2018-05-02) taught fsck to look at the content of .gitmodules files. If the object turns out not to be a blob at all, we just complain and punt on checking the content. And since this was such an obvious and trivial code path, I didn't even bother