Re: [PATCH v2 3/4] merge: make prepare_to_commit responsible for write_merge_state
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 11, 2014, 00:20 UTC
- Message-ID
- <xmqqha9b74iw.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <1389228344-38813-4-git-send-email-ryan@yaauie.com>
Ryan Biesemeyer <ryan@yaauie.com> writes:
Show 7 quoted lines
> + 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"
EOFcan'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?)
Show 7 quoted lines
> + git merge other && > + test "`git log -1 --pretty=format:%s`" = "Merge branch '"'"'other'"'"'" && > + test ! -s "$(git rev-parse --git-dir)/MERGE_HEAD" > + > +' > + > test_done