path: root/
diff options
authorDavid Aguilar <>2009-04-12 03:41:56 (GMT)
committerJunio C Hamano <>2009-04-12 22:19:12 (GMT)
commit47d65924a69576bd9f3254f7055de6b37a359596 (patch)
tree8476f9097193153c708498c78cc7e9bc3db6946e /
parent70af4e9bef988a98061237c78cbd0a71d8de48bb (diff)
mergetool--lib: simplify API usage by removing more global variables
The mergetool--lib scriplet was tricky to use because it relied upon the existance of several global shell variables. This removes more global variables so that things are simpler for callers. A side effect is that some variables are recomputed each time run_merge_tool() is called, but the overhead for recomputing them is justified by the simpler implementation. Signed-off-by: David Aguilar <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to '')
1 files changed, 3 insertions, 3 deletions
diff --git a/ b/
index b450036..57e8e32 100755
--- a/
+++ b/
@@ -47,9 +47,9 @@ launch_merge_tool () {
test -n "$GIT_MERGE_TOOL" && merge_tool="$GIT_MERGE_TOOL"
test -n "$GIT_DIFF_TOOL" && merge_tool="$GIT_DIFF_TOOL"
-merge_tool=$(get_merge_tool "$merge_tool") || exit
-merge_tool_cmd="$(get_merge_tool_cmd "$merge_tool")"
-merge_tool_path="$(get_merge_tool_path "$merge_tool")" || exit
+if test -z "$merge_tool"; then
+ merge_tool="$(get_merge_tool)" || exit
# Launch the merge tool on each path provided by 'git diff'
while test $# -gt 6