Empty Refs Map [message #647361] |
Wed, 05 January 2011 18:55 |
Brian Messages: 6 Registered: January 2011 |
Junior Member |
|
|
Ok, I finally broke down and downloaded the jgit project due to the fact that there's not really much documentation available, so I'm looking through the source code to try to figure this out. Not having much luck though.
Basically what's happening is my refs map in my repository is coming back empty (not null, just empty).
Here's my repository initialization code, maybe you can tell me what I'm missing:
Config config = (Config) ConfigManager.getInstance().getConfig(Config.class);
FileRepositoryBuilder builder = new FileRepositoryBuilder();
builder = builder.setGitDir(new File(config.getGitRepoDirectory())); //repo directory points to my project root
Repository repo = builder.findGitDir().build();
System.out.println(repo.getAllRefs()); //Prints "[]"
git = new Git(repo);
*edit*
I'm aware that this differs from the user guide's example of setting up a a repository; however the example in the user guide appears to be broken.
*edit 2*
I did a System.out.println(repo.getRepositoryState()); and it appears JGit thinks it's working with a bare repository, in spite of the presence of a .git directory and all that goes with it
[Updated on: Wed, 05 January 2011 21:11] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03107 seconds