diff options
author | Shawn Pearce <spearce@spearce.org> | 2014-11-24 20:05:34 -0800 |
---|---|---|
committer | Shawn Pearce <sop@google.com> | 2014-11-25 10:21:48 -0800 |
commit | f31323745f90aeb8f0b9bd0df4248363fc284bfe (patch) | |
tree | bbadcc9e5827f9d1d96e5f86128ef9cf852d2f5c /org.eclipse.jgit.test | |
parent | 7865d7100e2a5f9d02f6679daada0c64ae14935f (diff) | |
download | jgit-f31323745f90aeb8f0b9bd0df4248363fc284bfe.tar.gz jgit-f31323745f90aeb8f0b9bd0df4248363fc284bfe.zip |
DirCache: Buffer TREE extension to $GIT_DIR
Increase the in-memory buffer for the TREE extension to 5 MiB, and
overflow to $GIT_DIR instead of /tmp. Using a larger buffer reduces
the chances a repository will overflow and need to spool the extension
to disk. Using $GIT_DIR allows the TREE extension contents to have
the same file system protections as the final $GIT_DIR/index.
Wrap the entire thing in a try/finally to ensure the temp file is
deleted from disk after the block has finished using it. To avoid
dangling NFS files, LocalFile.destroy() does close the local file
before deleting it.
Change-Id: I8f871181a4689e3ebf0cdd4fd1769333cf7546c3
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheCGitCompatabilityTest.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheCGitCompatabilityTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheCGitCompatabilityTest.java index 53d672d7f3..7f58a1cbed 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheCGitCompatabilityTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheCGitCompatabilityTest.java @@ -213,7 +213,7 @@ public class DirCacheCGitCompatabilityTest extends LocalDiskRepositoryTestCase { assertV3TreeEntry(9, "newfile.txt", false, true, dc); final ByteArrayOutputStream bos = new ByteArrayOutputStream(); - dc.writeTo(bos); + dc.writeTo(null, bos); final byte[] indexBytes = bos.toByteArray(); final byte[] expectedBytes = IO.readFully(file); assertArrayEquals(expectedBytes, indexBytes); |