Commit | Line | Data |
---|---|---|
bc7a96a8 | 1 | diff_cmd () { |
950b5680 DA |
2 | empty_file= |
3 | ||
3facc600 | 4 | # p4merge does not like /dev/null |
3facc600 DA |
5 | if test "/dev/null" = "$LOCAL" |
6 | then | |
950b5680 | 7 | LOCAL="$(create_empty_file)" |
3facc600 DA |
8 | fi |
9 | if test "/dev/null" = "$REMOTE" | |
10 | then | |
950b5680 | 11 | REMOTE="$(create_empty_file)" |
3facc600 DA |
12 | fi |
13 | ||
bc7a96a8 | 14 | "$merge_tool_path" "$LOCAL" "$REMOTE" |
3facc600 | 15 | |
950b5680 | 16 | if test -n "$empty_file" |
3facc600 | 17 | then |
950b5680 | 18 | rm -f "$empty_file" |
3facc600 | 19 | fi |
bc7a96a8 DA |
20 | } |
21 | ||
22 | merge_cmd () { | |
4549162e KB |
23 | if ! $base_present |
24 | then | |
25 | cp -- "$LOCAL" "$BASE" | |
26 | create_virtual_base "$BASE" "$REMOTE" | |
27 | fi | |
c699a7cc | 28 | "$merge_tool_path" "$BASE" "$REMOTE" "$LOCAL" "$MERGED" |
bc7a96a8 | 29 | } |
950b5680 DA |
30 | |
31 | create_empty_file () { | |
32 | empty_file="${TMPDIR:-/tmp}/git-difftool-p4merge-empty-file.$$" | |
33 | >"$empty_file" | |
34 | ||
d272c849 | 35 | printf "%s" "$empty_file" |
950b5680 | 36 | } |