merge-file: correctly open files when in a subdir
commit204a8ffe67d2b789a34a14a06618a24756f7d9a9
authorAleksander Boruch-Gruszecki <aleksander.boruchgruszecki@gmail.com>
Sun, 8 Feb 2015 16:53:53 +0000 (8 17:53 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 11 Feb 2015 19:01:50 +0000 (11 11:01 -0800)
treeae27dede5a5b4501c9afd7742154554a105b2d47
parent3d8a54eb37d298c251c0b6823dc06935a611bc33
merge-file: correctly open files when in a subdir

run_setup_gently() is called before merge-file. This may result in changing
current working directory, which wasn't taken into account when opening a file
for writing.

Fix by prepending the passed prefix. Previous var is left so that error
messages keep referring to the file from the user's working directory
perspective.

Signed-off-by: Aleksander Boruch-Gruszecki <aleksander.boruchgruszecki@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/merge-file.c
t/t6023-merge-file.sh