2011-08-18 09:23:46 +02:00
|
|
|
diff_cmd () {
|
2012-12-27 01:45:29 +01:00
|
|
|
empty_file=
|
|
|
|
|
2012-10-11 05:22:36 +02:00
|
|
|
# p4merge does not like /dev/null
|
|
|
|
if test "/dev/null" = "$LOCAL"
|
|
|
|
then
|
2012-12-27 01:45:29 +01:00
|
|
|
LOCAL="$(create_empty_file)"
|
2012-10-11 05:22:36 +02:00
|
|
|
fi
|
|
|
|
if test "/dev/null" = "$REMOTE"
|
|
|
|
then
|
2012-12-27 01:45:29 +01:00
|
|
|
REMOTE="$(create_empty_file)"
|
2012-10-11 05:22:36 +02:00
|
|
|
fi
|
|
|
|
|
2011-08-18 09:23:46 +02:00
|
|
|
"$merge_tool_path" "$LOCAL" "$REMOTE"
|
2012-10-11 05:22:36 +02:00
|
|
|
|
2012-12-27 01:45:29 +01:00
|
|
|
if test -n "$empty_file"
|
2012-10-11 05:22:36 +02:00
|
|
|
then
|
2012-12-27 01:45:29 +01:00
|
|
|
rm -f "$empty_file"
|
2012-10-11 05:22:36 +02:00
|
|
|
fi
|
2011-08-18 09:23:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
merge_cmd () {
|
|
|
|
touch "$BACKUP"
|
|
|
|
$base_present || >"$BASE"
|
|
|
|
"$merge_tool_path" "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
|
|
|
|
check_unchanged
|
|
|
|
}
|
2012-12-27 01:45:29 +01:00
|
|
|
|
|
|
|
create_empty_file () {
|
|
|
|
empty_file="${TMPDIR:-/tmp}/git-difftool-p4merge-empty-file.$$"
|
|
|
|
>"$empty_file"
|
|
|
|
|
|
|
|
printf "$empty_file"
|
|
|
|
}
|