]> source.dussan.org Git - jgit.git/commit
DirCache: Buffer TREE extension to $GIT_DIR 66/36966/2
authorShawn Pearce <spearce@spearce.org>
Tue, 25 Nov 2014 04:05:34 +0000 (20:05 -0800)
committerShawn Pearce <sop@google.com>
Tue, 25 Nov 2014 18:21:48 +0000 (10:21 -0800)
commitf31323745f90aeb8f0b9bd0df4248363fc284bfe
treebbadcc9e5827f9d1d96e5f86128ef9cf852d2f5c
parent7865d7100e2a5f9d02f6679daada0c64ae14935f
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
org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheCGitCompatabilityTest.java
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java