From: Junio C Hamano <gitster@pobox.com>
To: Daniel Barkalow <barkalow@iabervon.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/2] Allow callers of unpack_trees() to handle failure
Date: Sun, 02 Dec 2007 22:24:19 -0800 [thread overview]
Message-ID: <7v63zgqorw.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0712030032400.5349@iabervon.org> (Daniel Barkalow's message of "Mon, 3 Dec 2007 00:32:42 -0500 (EST)")
Daniel Barkalow <barkalow@iabervon.org> writes:
> Return an error from unpack_trees() instead of calling die(), and exit
> with an error in read-tree. The merge function can return negative to
> abort.
>
> This will be used in builtin-checkout -m.
>
> Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
> ---
> builtin-read-tree.c | 3 +-
> unpack-trees.c | 85 ++++++++++++++++++++++++++++----------------------
> 2 files changed, 50 insertions(+), 38 deletions(-)
>
> diff --git a/builtin-read-tree.c b/builtin-read-tree.c
> index 43cd56a..4f680c3 100644
> --- a/builtin-read-tree.c
> +++ b/builtin-read-tree.c
> @@ -269,7 +269,8 @@ int cmd_read_tree(int argc, const char **argv, const char *unused_prefix)
> parse_tree(tree);
> init_tree_desc(t+i, tree->buffer, tree->size);
> }
> - unpack_trees(nr_trees, t, &opts);
> + if (unpack_trees(nr_trees, t, &opts))
> + return 128;
Magic 128 when everybody else in the patch returns -1 for error?
Otherwise the changes seem sensible, as long as the callers are paying
attention to the return values, which I admit that I did not check.
next prev parent reply other threads:[~2007-12-03 6:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-03 5:32 [PATCH 1/2] Allow callers of unpack_trees() to handle failure Daniel Barkalow
2007-12-03 6:24 ` Junio C Hamano [this message]
2007-12-03 6:31 ` Daniel Barkalow
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7v63zgqorw.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=barkalow@iabervon.org \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox