Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> writes:
> Trivially tested with
>
> git merge HEAD^ HEAD^^
>
> which did the wrong thing before, and now works.
>
> Linus
>
> ---
> builtin/merge.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/builtin/merge.c b/builtin/merge.c
> index 016a4dbee3b5..28fb5c9d6ada 100644
> --- a/builtin/merge.c
> +++ b/builtin/merge.c
> @@ -1370,8 +1370,7 @@ int cmd_merge(int argc, const char **argv, const
> char *prefix)
>
> if (!common)
> ; /* No common ancestors found. We need a real merge. */
> - else if (!remoteheads->next && !common->next &&
> - common->item == remoteheads->item) {
> + else if (!parents->next && parents->item == head_commit) {
When everybody in remote_heads is an ancestor of the current HEAD,
finalize_parents() would have reduced parents to a single element list
with HEAD on it, and we are "already up-to-date". Ok.
I wonder if use of remoteheads later in the same function are correct,
though. We equate "!remoteheads->next" and "We are not doing octopus",
for example.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Newbies FAQ] [Linux Kernel Development] [Free Online Dating] [Gcc Help] [IETF Annouce] [DCCP] [Netdev] [Networking] [Security] [V4L] [Bugtraq] [Free Online Dating] [Photo] [Yosemite] [MIPS Linux] [ARM Linux] [Linux Security] [Linux RAID] [Linux SCSI] [Fedora Users] [Linux Resources]