mergetool: fix running in subdir when rerere enabled
commitd0e0cfe745e0c88ca2f4d4ed9f1d2871b659d872
authorRichard Hansen <hansenr@google.com>
Tue, 10 Jan 2017 20:42:02 +0000 (10 15:42 -0500)
committerJunio C Hamano <gitster@pobox.com>
Tue, 10 Jan 2017 21:22:51 +0000 (10 13:22 -0800)
tree8333fea31498b202eda76db1ff77e0bc3c3cb5f1
parentc1b0d3a010eaed0d7683fe0593132f2211467b20
mergetool: fix running in subdir when rerere enabled

"git mergetool" (without any pathspec on the command line) that is
not run from the top-level of the working tree no longer works in
Git v2.11, failing to get the list of unmerged paths from the output
of "git rerere remaining".  This regression was introduced by
57937f70a0 ("mergetool: honor diff.orderFile", 2016-10-07).

This is because the pathnames output by the 'git rerere remaining'
command are relative to the top-level directory but the 'git diff
--name-only' command expects its pathname arguments to be relative
to the current working directory.  To make everything consistent,
cd_to_toplevel before running 'git diff --name-only' and adjust any
relative pathnames.

Signed-off-by: Richard Hansen <hansenr@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-mergetool.sh
t/t7610-mergetool.sh