Re: [PATCH] Also read SQUASH_MSG if a conflict on a merge squash occurred

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

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

> The duplicated code to read the same file bothers me somewhat.
>
> I wondered if it makes the result easier to follow (and easier to
> update) if this part of the code is restructured like this:
>
> 	if (file_exists(git_path_merge_msg()) ||
>             file_exists(git_path_squash_msg())) {
> 	    if (file_exists(git_path_squash_msg())) {
> 		read SQUASH_MSG;
> 	    }
>             if (file_exists(git_path_merge_msg()))
>             	read MERGE_MSG;
> 	    }
>             hook_arg1 = "merge";
> 	}
>
> but I am not sure if that structure is better.

... as this duplicates file_exists() call to the same thing, which
is no better than duplicated calls to read *_MSG files.


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