Give ssh a better chance of working on Windows.
Switch the type of quotes used for the remote command.
Open the pipe in binary mode.
%% no merges expected%% merge of b expectedmerging for bmerging b%%Contents of b should be "this is file b1"This is file b1%% merge expected!merging for bmerging b%% merge of b expectedmerging for bmerging b