Subject: Re: [PATCH v3 1/6] commit-graph: return with errors during write

From: Ævar Arnfjörð Bjarmason <[email-masked]>
Date: Wed, 01 May 2019 16:46:24 +0200

On Wed, May 01 2019, Derrick Stolee via GitGitGadget wrote:

> From: Derrick Stolee <[email-masked]>
>
> 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.