Re: [PATCH 1/2] tree-walk: be more specific about corrupt tree errors

2016-09-27 Thread David Turner
On Tue, 2016-09-27 at 01:14 -0400, Jeff King wrote: > I also wonder if $bin_sha1 should actually be more like: > > hex_sha1=$(echo foo | git hash-object --stdin -w) > bin_sha1=$(echo $hex_sha1 | perl -ne 'printf "\\%3o", ord for /./g') > > so that it's a real sha1 (or maybe it is in your

Re: [PATCH 1/2] tree-walk: be more specific about corrupt tree errors

2016-09-26 Thread Junio C Hamano
Jeff King writes: >> +test_expect_success 'malformed mode in tree' ' >> +test_must_fail git hash-object -t tree >> ../t1007/tree-with-malformed-mode 2>err && >> +grep "malformed mode in tree entry for tree" err >> +' > > This ".." will break when the test is run with

Re: [PATCH 1/2] tree-walk: be more specific about corrupt tree errors

2016-09-26 Thread Jeff King
On Mon, Sep 26, 2016 at 03:32:44PM -0400, David Turner wrote: > From: Jeff King > > When the tree-walker runs into an error, it just calls > die(), and the message is always "corrupt tree file". > However, we are actually covering several cases here; let's > give the user a hint

[PATCH 1/2] tree-walk: be more specific about corrupt tree errors

2016-09-26 Thread David Turner
From: Jeff King When the tree-walker runs into an error, it just calls die(), and the message is always "corrupt tree file". However, we are actually covering several cases here; let's give the user a hint about what happened. Let's also avoid using the word "corrupt", which