summaryrefslogtreecommitdiff
path: root/git-mergetool--lib.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-06-29 17:09:27 -0700
committerJunio C Hamano <gitster@pobox.com>2011-06-29 17:09:27 -0700
commit4ed54610e5ca8fdc34dcf8729f6416599d1bc39e (patch)
tree3eca1184326848950e0a35938c7ca7032e45a6a1 /git-mergetool--lib.sh
parent55ac692661f7b850bb0160de18fa9868d24dbe17 (diff)
parentc35ec8c901a2391c4652ab1acdff04c9d67b1543 (diff)
downloadgit-4ed54610e5ca8fdc34dcf8729f6416599d1bc39e.tar.gz
Merge branch 'da/git-prefix-everywhere' into next
* da/git-prefix-everywhere: t/t7503-pre-commit-hook.sh: Add GIT_PREFIX tests git-mergetool--lib: Make vimdiff retain the current directory git: Remove handling for GIT_PREFIX setup: Provide GIT_PREFIX to built-ins
Diffstat (limited to 'git-mergetool--lib.sh')
-rw-r--r--git-mergetool--lib.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh
index 4db9212331..91f90acfba 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
;;