aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectInserter.java
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2012-03-15 07:21:14 -0700
committerShawn O. Pearce <spearce@spearce.org>2012-03-15 07:22:24 -0700
commitff13648ea295bba02ca192c00a39335b05468abe (patch)
tree752f455106b746df570ad5c4f7bf529d2ad3b635 /org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectInserter.java
parent9be6526e9dbcfaca168dd66caac36a9316d44d88 (diff)
downloadjgit-ff13648ea295bba02ca192c00a39335b05468abe.tar.gz
jgit-ff13648ea295bba02ca192c00a39335b05468abe.zip
Revert "Quickfix for AutoCRLF handling"
This reverts commit 88fe2836edab8d8ce82d28acd9d07b061988ff3a. Auto CRLF isn't special enough to be screwing around with the buffers used for raw byte processing of the ObjectInserter API. If it needs a buffer to process a file that is bigger than the buffer allocated by an ObjectInserter, it needs to do its own buffer management. Change-Id: Ida4aaa80d0f9f78035f3d2a9ebdde904c980f89a
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectInserter.java')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectInserter.java25
1 files changed, 1 insertions, 24 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectInserter.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectInserter.java
index e03fe35719..0355e56f5f 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectInserter.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectInserter.java
@@ -109,29 +109,6 @@ public abstract class ObjectInserter {
return tempBuffer;
}
- static private final int tempBufSize;
- static {
- String s = System.getProperty("jgit.tempbufmaxsize");
- if (s != null)
- tempBufSize = Integer.parseInt(s);
- else
- tempBufSize = 1000000;
- }
-
- /**
- * @param hintSize
- * @return a temporary byte array for use by the caller
- */
- protected byte[] buffer(long hintSize) {
- if (hintSize >= tempBufSize)
- tempBuffer = new byte[0];
- else if (tempBuffer == null)
- tempBuffer = new byte[(int) hintSize];
- else if (tempBuffer.length < hintSize)
- tempBuffer = new byte[(int) hintSize];
- return tempBuffer;
- }
-
/** @return digest to help compute an ObjectId */
protected MessageDigest digest() {
digest.reset();
@@ -195,7 +172,7 @@ public abstract class ObjectInserter {
md.update((byte) ' ');
md.update(Constants.encodeASCII(length));
md.update((byte) 0);
- byte[] buf = buffer(length);
+ byte[] buf = buffer();
while (length > 0) {
int n = in.read(buf, 0, (int) Math.min(length, buf.length));
if (n < 0)