On Sat, Oct 16, 2010 at 13:33, Thomas Rast <trast@student.ethz.ch> wrote:
Show 33 quoted lines
> Since b541248 (merge.conflictstyle: choose between "merge" and "diff3
> -m" styles, 2008-08-29), git-merge-file uses setup_directory_gently(),
> thus cd'ing around to find any possible config files to use.
>
> This broke merge-file when it is called from within a subdirectory of
> a repository, and the arguments are all relative paths.
>
> Fix by prepending the prefix, as passed down from the main git
> executable, if there is any.
>
> Signed-off-by: Thomas Rast <trast@student.ethz.ch>
> ---
> builtin/merge-file.c | 11 ++++++++++-
> t/t6023-merge-file.sh | 8 ++++++++
> 2 files changed, 18 insertions(+), 1 deletions(-)
>
> diff --git a/builtin/merge-file.c b/builtin/merge-file.c
> index b6664d4..b873fee 100644
> --- a/builtin/merge-file.c
> +++ b/builtin/merge-file.c
> @@ -65,10 +66,18 @@ int cmd_merge_file(int argc, const char **argv, const char *prefix)
> "%s\n", strerror(errno));
> }
>
> + if (prefix)
> + prefixlen = strlen(prefix);
> +
> for (i = 0; i < 3; i++) {
> + const char *name;
> + if (prefix)
> + name = prefix_filename(prefix, prefixlen, argv[i]);
> + else
> + name = argv[i];