Re: [PATCH] add -u: do not fail to resolve a path as deleted

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

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

> After you resolve a conflicted merge to remove the path, "git add -u"
> failed to record the removal.  Instead it errored out by saying that the
> removed path is not found in the work tree, but that is what the user
> wanted to do and failing it is illogical.
>
> This fixes it.
>
> Signed-off-by: Junio C Hamano <gitster@xxxxxxxxx>
> ---
>  read-cache.c          |    5 +++++
>  t/t2200-add-update.sh |   20 +++++++++++++++++++-
>  2 files changed, 24 insertions(+), 1 deletions(-)
>
> diff --git a/read-cache.c b/read-cache.c
> index b1475ff..ddc0586 100644
> --- a/read-cache.c
> +++ b/read-cache.c
> @@ -1574,6 +1574,11 @@ static void update_callback(struct diff_queue_struct *q,
>  		default:
>  			die("unexpected diff status %c", p->status);
>  		case DIFF_STATUS_UNMERGED:
> +			/*
> +			 * diff-files gives U followed by the work tree state
> +			 * such as M or D, so we can ignore this.
> +			 */
> +			continue;

This is wrong; breaks t3702.
--
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