Commit | Line | Data |
---|---|---|
bc7a96a8 DA |
1 | diff_cmd () { |
2 | "$merge_tool_path" "$LOCAL" "$REMOTE" | |
3 | } | |
4 | ||
5 | merge_cmd () { | |
f61bd9c6 DA |
6 | if test -z "${meld_has_output_option:+set}" |
7 | then | |
8 | check_meld_for_output_version | |
9 | fi | |
bc7a96a8 | 10 | touch "$BACKUP" |
f61bd9c6 DA |
11 | if test "$meld_has_output_option" = true |
12 | then | |
13 | "$merge_tool_path" --output "$MERGED" \ | |
14 | "$LOCAL" "$BASE" "$REMOTE" | |
15 | else | |
16 | "$merge_tool_path" "$LOCAL" "$MERGED" "$REMOTE" | |
17 | fi | |
bc7a96a8 DA |
18 | check_unchanged |
19 | } | |
f61bd9c6 DA |
20 | |
21 | # Check whether 'meld --output <file>' is supported | |
22 | check_meld_for_output_version () { | |
23 | meld_path="$(git config mergetool.meld.path)" | |
24 | meld_path="${meld_path:-meld}" | |
25 | ||
759a904e | 26 | if "$meld_path" --help 2>&1 | grep -e --output >/dev/null |
f61bd9c6 DA |
27 | then |
28 | meld_has_output_option=true | |
29 | else | |
30 | meld_has_output_option=false | |
31 | fi | |
32 | } |