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

Bug 368697

Summary: Jgit cannot cope if the respository version is unset
Product: [Technology] JGit Reporter: Alan McGovern <alan.mcgovern>
Component: JGitAssignee: Kevin Sawicki <kevin>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: caniszczyk
Version: unspecified   
Target Milestone: 2.0-M1   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Alan McGovern CLA 2012-01-16 06:22:45 EST
The github for mac tool generates .git repositories without setting the 'repository version' in the config file. I reported this several months ago to them but I don't know if they fixed it yet. Currently jgit parses the config file and does this check at line 187 in FileRepository.java

if (!"0".equals(repositoryFormatVersion))

This means jgit is incapable of reading repositories created by the github tool. We have been running with a patch to change this line into the equivalent of:


if (!IsNullOrEmpty (repositoryVersion) && !"0".equals(repositoryFormatVersion))

It makes sense to treat a lack of value as being the same as meaning the default value of '0' has been set. This allows jgit to open github for mac repositories correctly.
Comment 1 Kevin Sawicki CLA 2012-03-01 19:28:44 EST
Proposed fix pushed to https://git.eclipse.org/r/#/c/5217
Comment 2 Chris Aniszczyk CLA 2012-03-21 17:06:00 EDT
Fixed in master now.