diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh
index 4db9212331259664732f031438b7b87b7a10244f..91f90acfba2a710644f4a076d27d50e0fbb33c2d 100644 (file)
--- a/git-mergetool--lib.sh
+++ b/git-mergetool--lib.sh
}
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
check_unchanged
else
"$merge_tool_path" -R -f -d -c "wincmd l" \
+ -c 'cd $GIT_PREFIX' \
"$LOCAL" "$REMOTE"
fi
;;
check_unchanged
else
"$merge_tool_path" -R -f -d -c "wincmd l" \
+ -c 'cd $GIT_PREFIX' \
"$LOCAL" "$REMOTE"
fi
;;