stash: teach 'push' (and 'create_stash') to honor pathspec
[git.git] / mergetools / p4merge
blob7a5b291dd28ad5b60ca0492480b800aaa9cc929e
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         if ! $base_present
24         then
25                 cp -- "$LOCAL" "$BASE"
26                 create_virtual_base "$BASE" "$REMOTE"
27         fi
28         "$merge_tool_path" "$BASE" "$REMOTE" "$LOCAL" "$MERGED"
31 create_empty_file () {
32         empty_file="${TMPDIR:-/tmp}/git-difftool-p4merge-empty-file.$$"
33         >"$empty_file"
35         printf "%s" "$empty_file"