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);
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.
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
Never mind. Just figured it out - apparently the repository builder is expecting me to point to the .git directory, not just the project root. Hopefully this doesn't mean it won't work with my checked-out copy of the repository....
Of course, now I've got a new exception, but I'll work on that one for a while before posting again