From 6884ea24cd0fcce78e9653e4d1a658eefa2cd68a Mon Sep 17 00:00:00 2001 From: Shawn Pearce Date: Wed, 1 Apr 2015 12:53:00 -0700 Subject: [PATCH] Use local GIT_DIR for overflow during merge conflicts By writing the temporary overflow merge result to $GIT_DIR JGit can ensure the same filesystem permissions apply to protect the file contents. If no directory is available from the repository (e.g. DfsRepository) null will be passed and the system temporary directory will be used instead. Change-Id: I95532aa092676d18f1dc1e3fdbe6dcb1f91b782e --- org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java b/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java index 923224b31..1ddac1b57 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java @@ -804,7 +804,8 @@ public class ResolveMerger extends ThreeWayMerger { private ObjectId insertMergeResult(MergeResult result) throws IOException { - TemporaryBuffer.LocalFile buf = new TemporaryBuffer.LocalFile(10 << 20); + TemporaryBuffer.LocalFile buf = new TemporaryBuffer.LocalFile( + db.getDirectory(), 10 << 20); try { new MergeFormatter().formatMerge(buf, result, Arrays.asList(commitNames), CHARACTER_ENCODING);