Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 340880

Summary: when FETCH_HEAD is over 4k in size, "File is too large" IOException is thrown
Product: [Technology] JGit Reporter: Antonio Gonzalez <antonio>
Component: JGitAssignee: Carsten Pfeiffer <carsten.pfeiffer>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: antonio, caniszczyk, carsten.pfeiffer, robin.rosenberg, sop
Version: 0.11   
Target Milestone: 0.12-M2   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Patch to bump up file size buffer none

Description Antonio Gonzalez CLA 2011-03-24 11:57:23 EDT
Build Identifier: 20100617-1415

When a git cvsimport is done, FETCH_HEAD may have a lot of entries in it, definitely over the hard coded 4k file size. When the larger file attempts to be loaded, the IOException is thrown, causing problems.

Reproducible: Always

Steps to Reproduce:
1.get a FETCH_HEAD file with lots of entries in it in your git repository. Make the file size > 4096 bytes.
2.Navigate to the git repository in Git Repository viewed in Eclipse
3.Notice the Reference tag section for the repo is red, and check the Eclipse Error log for a "File Size is too Large" IOException
Comment 1 Antonio Gonzalez CLA 2011-03-24 12:00:06 EDT
Created attachment 191839 [details]
Patch to bump up file size buffer

I bumped up the file size from 4096 to 264144. The FETCH_HEAD size that initially caused the problem was 41k in size, so 264k should be plenty for most cvsimport "do not merge" files.
Comment 2 Chris Aniszczyk CLA 2011-03-31 10:52:36 EDT
I recall Shawn doing some work in this area but I can't find the patch on Gerrit... anyways, if you want to contribute your patch you'll have to do it via our Gerrit instance...

http://wiki.eclipse.org/EGit/Contributor_Guide#Contributing_Patches

I don't think this is the right solution, but we'll have to wait for Shawn's comments...
Comment 3 Antonio Gonzalez CLA 2011-03-31 11:10:12 EDT
Sounds good. This'll get my camp over the hump in the near future, but you're right there's gotta be a better way. I'm not very familiar with the code or why it's trying to set a max file size but I'd also be happy to take some direction and run with it to help out.
Comment 4 Chris Aniszczyk CLA 2011-04-01 18:40:21 EDT
Here's a patch for review that should help you with your problem...

http://egit.eclipse.org/r/#change,2739

Can you please test it?
Comment 5 Chris Aniszczyk CLA 2011-04-01 21:27:27 EDT
Fixed in master now, 11e2e746c13cc94cabc96e708f3c6a2b159b5995.
Comment 6 Robin Rosenberg CLA 2013-01-03 20:17:08 EST
*** Bug 340714 has been marked as a duplicate of this bug. ***