I've been trying to get org.eclipse.jgit.junit.http.SimpleHttpServer working properly, and I can't seem to get it there.
First I create a repository in /sbasic/remote:
$ cd /sbasic
$ mkdir remote
$ cd remote
$ git init
$ echo hello > file.txt
$ git add file.txt
$ git commit -am "first commit"
[master (root-commit) 2734fd2] first commit
1 file changed, 1 insertion(+)
create mode 100644 file.txt
I then run the following program:
Repository db = new FileRepository("/sbasic/remote");
SimpleHttpServer server = new SimpleHttpServer(db, false);
System.out.println(server.getUri().toString());
server.start();
while(true);
While the above is infinite looping at the end, I go to the command line in a different location (/tmp, say) and enter:
git clone <Uri>
where Uri is the one displayed by the program. Here's a sample session I get:
$ git clone http://127.0.0.1:43511/sbasic/remote
Cloning into 'remote'...
Username for 'http://127.0.0.1:43511': agitter
Password for 'http://agitter@127.0.0.1:43511': letmein
Checking connectivity... done.
warning: remote HEAD refers to nonexistent ref, unable to checkout.
Any ideas what I'm doing wrong here? I can't figure out why I'm getting that remote HEAD error.