From: Ævar Arnfjörð Bjarmason Date: Wed, 01 May 2019 14:46:24 GMT Subject: Re: [PATCH v3 1/6] commit-graph: return with errors during write Message-ID: <87pnp2qlkv.fsf@evledraar.gmail.com> In-Reply-To: <91f300ec0acd825494fa13d93cdc4770bbf2ac14.1556716272.git.gitgitgadget@gmail.com> On Wed, May 01 2019, Derrick Stolee via GitGitGadget wrote: > From: Derrick Stolee > > The write_commit_graph() method uses die() to report failure and > exit when confronted with an unexpected condition. This use of > die() in a library function is incorrect and is now replaced by > error() statements and an int return type. > > Now that we use 'goto cleanup' to jump to the terminal condition > on an error, we have new paths that could lead to uninitialized > values. New initializers are added to correct for this. > > The builtins 'commit-graph', 'gc', and 'commit' call these methods, > so update them to check the return value. Seems good to have a test to check for some of this behavior. I see that can be done as just: echo doesnotexist | git commit-graph write --stdin-packs And checking the exit code is 1 as it is now, not 128.