Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 368697 - Jgit cannot cope if the respository version is unset
Summary: Jgit cannot cope if the respository version is unset
Status: RESOLVED FIXED
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 2.0-M1   Edit
Assignee: Kevin Sawicki CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-16 06:22 EST by Alan McGovern CLA
Modified: 2012-03-21 17:06 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.