X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-mergetool--lib.sh;h=91f90acfba2a710644f4a076d27d50e0fbb33c2d;hb=1acf11717f01b542e099544796f00df567a66e90;hp=4db9212331259664732f031438b7b87b7a10244f;hpb=a852aac48d881d538e24d5493e218a93b12b1709;p=git.git diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh index 4db921233..91f90acfb 100644 --- a/git-mergetool--lib.sh +++ b/git-mergetool--lib.sh @@ -86,6 +86,11 @@ get_merge_tool_cmd () { } run_merge_tool () { + # If GIT_PREFIX is empty then we cannot use it in tools + # that expect to be able to chdir() to its value. + GIT_PREFIX=${GIT_PREFIX:-.} + export GIT_PREFIX + merge_tool_path="$(get_merge_tool_path "$1")" || exit base_present="$2" status=0 @@ -188,6 +193,7 @@ run_merge_tool () { check_unchanged else "$merge_tool_path" -R -f -d -c "wincmd l" \ + -c 'cd $GIT_PREFIX' \ "$LOCAL" "$REMOTE" fi ;; @@ -199,6 +205,7 @@ run_merge_tool () { check_unchanged else "$merge_tool_path" -R -f -d -c "wincmd l" \ + -c 'cd $GIT_PREFIX' \ "$LOCAL" "$REMOTE" fi ;;