When the --merge target does not exist, an empty index is created and
written before merging. The error from that write was discarded, so an
unwritable merge target let the command report success while no index
was created there. Propagate the error, matching the final index write
and the LoadIndexFile error handling in the same function.
Signed-off-by: zjncs <18910855655@163.com>