Subject: Re: [PATCH] merge-recursive: handle file mode and links similarly to file content

From: Clemens Buchacher <[email-masked]>
Date: Fri, 14 Mar 2008 11:13:49 +0100

On Fri, Mar 14, 2008 at 10:21:05AM +0100, Clemens Buchacher wrote:
> @@ -1051,14 +1066,11 @@ static struct merge_file_info merge_file(struct diff_filespec *o,
>  
>  			free(result_buf.ptr);
>  			result.clean = (merge_status == 0);
> -		} else if (S_ISGITLINK(a->mode)) {
> +			result.merge = 1;
> +		} else if (S_ISGITLINK(a->mode) || S_ISLNK(a->mode)) {
> +			hashcpy(result.sha, b->sha1);
>  			result.clean = 0;
> -			hashcpy(result.sha, a->sha1);
> -		} else if (S_ISLNK(a->mode)) {
> -			hashcpy(result.sha, a->sha1);
> -
> -			if (!sha_eq(a->sha1, b->sha1))
> -				result.clean = 0;
> +			result.merge = 1;

To clarify: The above two cases don't need to be handled separately any
more, because equal sha1s are already handled above.

Clemens