diff options
author | Jeff King <peff@peff.net> | 2012-10-25 06:42:57 -0400 |
---|---|---|
committer | Jeff King <peff@peff.net> | 2012-10-25 06:42:57 -0400 |
commit | 33d3c6bb9bcc10b9aa5e46f66ef516c649b2c703 (patch) | |
tree | 7715f2d419da7fbc136239f87649970132804417 /mergetools | |
parent | 4cd31a6320d28742a79ce3aed3e479670ccc159a (diff) | |
parent | 3facc60031a5b860cae8cb26957e5b4e80820c34 (diff) | |
download | git-33d3c6bb9bcc10b9aa5e46f66ef516c649b2c703.tar.gz |
Merge branch 'da/mergetools-p4'
* da/mergetools-p4:
mergetools/p4merge: Handle "/dev/null"
Diffstat (limited to 'mergetools')
-rw-r--r-- | mergetools/p4merge | 25 |
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 () { |