Subject: Re: [PATCH v2 3/4] merge: make prepare_to_commit responsible for write_merge_state

From: Junio C Hamano <[email-masked]>
Date: Fri, 10 Jan 2014 16:20:39 -0800

Ryan Biesemeyer <[email-masked]> writes:

> +	write_script "$HOOK" <<-EOF &&
> +	if [ -s "$(git rev-parse --git-dir)/MERGE_HEAD" ]; then
> +		exit 0
> +	else
> +		exit 1
> +	fi
> +	EOF

The script can be a one-liner

	write_scirpt "$HOOK" <<-\EOF &&
        test -s "$(git rev-parse --git-dir)/MERGE_HEAD"
	EOF

can't it?  I also do not think you want to have the rev-parse run
while writing the script (rather, you would want it run inside the
script, no?)

> +	git merge other &&
> +	test "`git log -1 --pretty=format:%s`" = "Merge branch '"'"'other'"'"'" &&
> +	test ! -s "$(git rev-parse --git-dir)/MERGE_HEAD"
> +
> +'
> +
>  test_done