Permalink
Browse files

Merge branch 'da/mergetools-p4'

* da/mergetools-p4:
  mergetools/p4merge: Handle "/dev/null"
  • Loading branch information...
2 parents 4cd31a6 + 3facc60 commit 33d3c6bb9bcc10b9aa5e46f66ef516c649b2c703 @peff peff committed Oct 25, 2012
Showing with 25 additions and 0 deletions.
  1. +25 −0 mergetools/p4merge
View
@@ -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 () {

0 comments on commit 33d3c6b

Please sign in to comment.