[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jgit-dev] Cloning empty repo over network protocol different than over file://

Hi,

I've found following. Cloning from a server running jGit (using http:, ssh: or git:) produces different results than cloning over file: (using git client) or when cloning from a server not running jGit (such as github).

The subtle difference is:

1) The message:
jGit produces:
"remote HEAD refers to nonexistent ref, unable to checkout"

Where standard git (file: or server) produces a message saying:
"You appear to have cloned an empty repository."

2) Content of the cloned repo:
Running: diff -ur gbt1 gbt2

produces:

diff -ur gbt1/.git/config gbt2/.git/config
--- gbt1/.git/config	2014-05-19 13:11:05.897758997 +0200
+++ gbt2/.git/config	2014-05-19 13:24:53.069744300 +0200
@@ -4,5 +4,8 @@
 	bare = false
 	logallrefupdates = true
 [remote "origin"]
-	url = ssh://admin@localhost:29418/gbt1.git
+	url = file:///tmp/gitblit/data/git/gbt1.git/
 	fetch = +refs/heads/*:refs/remotes/origin/*
+[branch "master"]
+	remote = origin
+	merge = refs/heads/master
Only in gbt1/.git: packed-refs

Packed refs (only in the repo cloned from jgit) contains:
# pack-refs with: peeled fully-peeled

I'm of the feeling that 1.x versions did not have this difference (this test was done gitblit using on jGit 3.3.1), but did not try so I'm not 100% sure.

Not sure if this is a bug so did not file it as one.

Thanks
Hrebejk