summaryrefslogtreecommitdiff
path: root/mergetools
diff options
context:
space:
mode:
authorLibravatar David Aguilar <davvid@gmail.com>2012-10-10 20:22:36 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-10-11 11:50:00 -0700
commit3facc60031a5b860cae8cb26957e5b4e80820c34 (patch)
tree3e7c56d63138b7c19c55a548552f0822f19d4ac8 /mergetools
parentattr: a note about the order of .gitattributes lookup (diff)
downloadtgif-3facc60031a5b860cae8cb26957e5b4e80820c34.tar.xz
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...
Diffstat (limited to 'mergetools')
-rw-r--r--mergetools/p4merge25
1 files changed, 25 insertions, 0 deletions
diff --git a/mergetools/p4merge b/mergetools/p4merge
index 1a45c1b0c5..295361a8aa 100644
--- a/mergetools/p4merge
+++ b/mergetools/p4merge
@@ -1,5 +1,30 @@
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"
+
+ if test -n "$rm_local"
+ then
+ rm -f "$LOCAL"
+ fi
+ if test -n "$rm_remote"
+ then
+ rm -f "$REMOTE"
+ fi
}
merge_cmd () {