Re: [PATCH] Avoid rename/add conflict when contents are identical

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Schalk, Ken" <ken.schalk@xxxxxxxxx> writes:

> diff --git a/merge-recursive.c b/merge-recursive.c
> index fb6aa4a..57c7a85 100644
> --- a/merge-recursive.c
> +++ b/merge-recursive.c
> @@ -955,6 +955,18 @@ static int process_renames(struct merge_options *o,
>                                                         ren1->pair->two : NULL,
>                                                         branch1 == o->branch1 ?
>                                                         NULL : ren1->pair->two, 1);
> +                       } else if ((dst_other.mode == ren1->pair->two->mode) &&
> +                                  sha_eq(dst_other.sha1, ren1->pair->two->sha1)) {
> +                               /* Added file on the other side
> +                                  identical to the file being
> +                                  renamed: clean merge */
> +                               update_file(o, 1, ren1->pair->two->sha1, ren1->pair->two->mode, ren1_dst);
> +                               if (!o->call_depth)
> +                                       update_stages(ren1_dst, NULL,
> +                                                       branch1 == o->branch1 ?
> +                                                       ren1->pair->two : NULL,
> +                                                       branch1 == o->branch1 ?
> +                                                       NULL : ren1->pair->two, 1);
>                         } else if (!sha_eq(dst_other.sha1, null_sha1)) {
>                                 const char *new_path;
>                                 clean_merge = 0;

The logic seems to be clear enough.  Could you write a test script instead
of description in the commit log message, so that future changes to the
codebase won't break this improvement?

Thanks.
--
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


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]