Re: [PATCH] t/t7001-mv.sh: Propose ability to use git-mv on conflicting entries

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

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

>> +# Rationale: I cannot git mv around a conflicted file. This is unnecessary
>> +# restriction in case another part of conflict resolution requires me to
>> +# move the file around.
>
> Yes, I would agree this is a reasonable thing to support.  Something like
> this patch, perhaps.
> ...

Just in case if somebody is inclined to test the patch and polish it into
a shape good enough for inclusion...

> @@ -177,7 +177,8 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
>  				} else
>  					bad = "Cannot overwrite";
>  			}
> -		} else if (cache_name_pos(src, length) < 0)
> +		} else if (((pos = cache_name_pos(src, length)) < 0) &&
> +			   strcmp(active_cache[-1 - pos]->name, src))

There is a bug here; "-1 - pos" needs to be checked against active_nr
before strcmp().

--
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]

  Powered by Linux