public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Thomas Rast <trast@inf•ethz.ch>
To: John Keeping <john@keeping•me.uk>
Cc: Junio C Hamano <gitster@pobox•com>, <git@vger•kernel.org>,
	"Charlie Smurthwaite" <charlie@atechmedia•com>
Subject: Re: Segfault with merge-tree on multiple Git versions
Date: Wed, 27 Mar 2013 17:05:01 +0100	[thread overview]
Message-ID: <874nfw7rrm.fsf@linux-k42r.v.cablecom.net> (raw)
In-Reply-To: <20130327155850.GN2286@serenity.lan> (John Keeping's message of "Wed, 27 Mar 2013 15:58:50 +0000")

John Keeping <john@keeping•me.uk> writes:

> merge-tree: fix typo in merge-tree.c::unresolved
>
> When calculating whether there is a d/f conflict, the calculation of
> whether both sides are directories generates an incorrect references
> mask because it does not use the loop index to set the correct bit.
> Fix this typo.
>
> Signed-off-by: John Keeping <john@keeping•me.uk>
>
> diff --git a/builtin/merge-tree.c b/builtin/merge-tree.c
> index e0d0b7d..bc912e3 100644
> --- a/builtin/merge-tree.c
> +++ b/builtin/merge-tree.c
> @@ -245,7 +245,7 @@ static void unresolved(const struct traverse_info *info, struct name_entry n[3])
>  	unsigned dirmask = 0, mask = 0;
>  
>  	for (i = 0; i < 3; i++) {
> -		mask |= (1 << 1);
> +		mask |= (1 << i);
>  		if (n[i].mode && S_ISDIR(n[i].mode))
>  			dirmask |= (1 << i);
>  	}

Indeed, that fixes it.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

  reply	other threads:[~2013-03-27 16:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-27 15:29 Segfault with merge-tree on multiple Git versions Charlie Smurthwaite
2013-03-27 15:53 ` thomas
2013-03-27 15:58   ` John Keeping
2013-03-27 16:05     ` Thomas Rast [this message]
2013-03-27 16:33     ` Junio C Hamano
2013-03-27 17:06 ` Junio C Hamano
2013-03-27 17:17   ` Charlie Smurthwaite
2013-03-27 17:52   ` Charlie Smurthwaite
2013-03-27 18:06     ` Jed Brown
2013-03-27 18:46       ` Charlie Smurthwaite
2013-03-27 19:16         ` Jed Brown
2013-03-27 19:45           ` John Keeping
2013-03-27 20:01             ` Jeff King
2013-03-27 21:10               ` Charlie Smurthwaite
2013-03-27 20:04             ` Junio C Hamano

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=874nfw7rrm.fsf@linux-k42r.v.cablecom.net \
    --to=trast@inf$(echo .)ethz.ch \
    --cc=charlie@atechmedia$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=gitster@pobox$(echo .)com \
    --cc=john@keeping$(echo .)me.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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