I think there are no redundant lines in this time's patch file.
And, I have tested the running of MERGE command with different situations. I am sorry that I didn't create regression test files, because I am not sure how to add new files in the git package. But, I have written web pages in Postgres Wiki. I explain the details of my implementation and a set of testing examples.
Please refer to the following pages if you are interested.