Browse Source

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
stable-4.1
Shawn Pearce 10 years ago
parent
commit
6884ea24cd
  1. 3
      org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java

3
org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java

@ -804,7 +804,8 @@ public class ResolveMerger extends ThreeWayMerger {
private ObjectId insertMergeResult(MergeResult<RawText> 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);

Loading…
Cancel
Save