Merge branch 'nd/branch-error-cases'
[alt-git.git] / mergetools / p4merge
blob52f7c8f70578929432becdd58a7fb423398f8de8
1 diff_cmd () {
2         empty_file=
4         # p4merge does not like /dev/null
5         if test "/dev/null" = "$LOCAL"
6         then
7                 LOCAL="$(create_empty_file)"
8         fi
9         if test "/dev/null" = "$REMOTE"
10         then
11                 REMOTE="$(create_empty_file)"
12         fi
14         "$merge_tool_path" "$LOCAL" "$REMOTE"
16         if test -n "$empty_file"
17         then
18                 rm -f "$empty_file"
19         fi
22 merge_cmd () {
23         touch "$BACKUP"
24         $base_present || >"$BASE"
25         "$merge_tool_path" "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
26         check_unchanged
29 create_empty_file () {
30         empty_file="${TMPDIR:-/tmp}/git-difftool-p4merge-empty-file.$$"
31         >"$empty_file"
33         printf "$empty_file"