Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>, git@vger.kernel.org
Subject: Re: Possible regression: overwriting untracked files in a fresh repo
Date: Mon, 24 Aug 2009 19:11:43 -0700	[thread overview]
Message-ID: <7vk50sve00.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20090825013601.GA3515@coredump.intra.peff.net> (Jeff King's message of "Mon\, 24 Aug 2009 21\:36\:01 -0400")

Jeff King <peff@peff.net> writes:

> diff --git a/builtin-checkout.c b/builtin-checkout.c
> index 8a9a474..1f2f84d 100644
> --- a/builtin-checkout.c
> +++ b/builtin-checkout.c
> @@ -402,7 +402,9 @@ static int merge_working_tree(struct checkout_opts *opts,
>  		topts.dir = xcalloc(1, sizeof(*topts.dir));
>  		topts.dir->flags |= DIR_SHOW_IGNORED;
>  		topts.dir->exclude_per_dir = ".gitignore";
> -		tree = parse_tree_indirect(old->commit->object.sha1);
> +		tree = parse_tree_indirect(old->commit ?
> +					   old->commit->object.sha1 :
> +					   (unsigned char *)EMPTY_TREE_SHA1_BIN);
>  		init_tree_desc(&trees[0], tree->buffer, tree->size);
>  		tree = parse_tree_indirect(new->commit->object.sha1);
>  		init_tree_desc(&trees[1], tree->buffer, tree->size);

This looks a lot saner; I like it.  Care to wrap it up with the usual
supporting material?

I think the "You appear to be" can just go, but I do not feel very
strongly either way.

  parent reply	other threads:[~2009-08-25  2:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-24 16:31 Possible regression: overwriting untracked files in a fresh repo Johannes Schindelin
2009-08-24 19:07 ` Jeff King
2009-08-24 22:39   ` Junio C Hamano
2009-08-24 23:20   ` Junio C Hamano
2009-08-25  1:36     ` Jeff King
2009-08-25  1:47       ` Jeff King
2009-08-25  2:11       ` Junio C Hamano [this message]
2009-08-25  3:03         ` Jeff King
2009-08-25 11:34           ` Johannes Schindelin

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=7vk50sve00.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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