mirror of
https://github.com/git/git
synced 2024-08-28 12:09:19 +00:00
mergetools/p4merge: Handle "/dev/null"
p4merge does not properly handle the case where "/dev/null" is passed as a filename. Work it around by creating a temporary file for this purpose. Reported-by: Jeremy Morton <admin@game-point.net> Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> --- Needs to be amended with Tested-by when a report comes...
This commit is contained in:
parent
40701adbcb
commit
3facc60031
|
@ -1,5 +1,30 @@
|
||||||
diff_cmd () {
|
diff_cmd () {
|
||||||
|
# p4merge does not like /dev/null
|
||||||
|
rm_local=
|
||||||
|
rm_remote=
|
||||||
|
if test "/dev/null" = "$LOCAL"
|
||||||
|
then
|
||||||
|
LOCAL="./p4merge-dev-null.LOCAL.$$"
|
||||||
|
>"$LOCAL"
|
||||||
|
rm_local=true
|
||||||
|
fi
|
||||||
|
if test "/dev/null" = "$REMOTE"
|
||||||
|
then
|
||||||
|
REMOTE="./p4merge-dev-null.REMOTE.$$"
|
||||||
|
>"$REMOTE"
|
||||||
|
rm_remote=true
|
||||||
|
fi
|
||||||
|
|
||||||
"$merge_tool_path" "$LOCAL" "$REMOTE"
|
"$merge_tool_path" "$LOCAL" "$REMOTE"
|
||||||
|
|
||||||
|
if test -n "$rm_local"
|
||||||
|
then
|
||||||
|
rm -f "$LOCAL"
|
||||||
|
fi
|
||||||
|
if test -n "$rm_remote"
|
||||||
|
then
|
||||||
|
rm -f "$REMOTE"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
merge_cmd () {
|
merge_cmd () {
|
||||||
|
|
Loading…
Reference in a new issue