diff options
author | David Aguilar <davvid@gmail.com> | 2009-04-11 20:41:56 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-04-12 15:19:12 -0700 |
commit | 47d65924a69576bd9f3254f7055de6b37a359596 (patch) | |
tree | 8476f9097193153c708498c78cc7e9bc3db6946e /git-mergetool.sh | |
parent | 70af4e9bef988a98061237c78cbd0a71d8de48bb (diff) | |
download | git-47d65924a69576bd9f3254f7055de6b37a359596.tar.gz |
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 <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-mergetool.sh')
-rwxr-xr-x | git-mergetool.sh | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/git-mergetool.sh b/git-mergetool.sh index 2e3e02b3b5..b52a7410bc 100755 --- a/git-mergetool.sh +++ b/git-mergetool.sh @@ -174,9 +174,11 @@ merge_file () { read ans fi - present=false - base_present && - present=true + if base_present; then + present=true + else + present=false + fi if ! run_merge_tool "$merge_tool" "$present"; then echo "merge of $MERGED failed" 1>&2 @@ -254,12 +256,11 @@ prompt_after_failed_merge() { done } -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 "$merge_tool") || exit +fi merge_keep_backup="$(git config --bool mergetool.keepBackup || echo true)" merge_keep_temporaries="$(git config --bool mergetool.keepTemporaries || echo false)" -merge_tool_trust_exit_code="$(git config --bool mergetool."$merge_tool".trustExitCode || echo false)" last_status=0 rollup_status=0 |