Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] Default branch symref

On Wed, Sep 30, 2020 at 8:35 AM Lee Worrall <worrall.la@xxxxxxxxx> wrote:
With github on the verge of changing its default initial branch name from master to main, I was looking at jgit support for symrefs in pack connections.

It looks to me like a HEAD symref is included in the capability line in UploadPack but it is not parsed in BasePackConnection.

I have a small patch that adds any SymRefs into the advertisedRefs and uses any HEAD symref in CloneCommand before looking for a branch called master. Is there any interest in adding this?

I tried to clone a repository which has HEAD set to branch main using the
jgit command line client (current master) and that checked out the main branch after cloning:

$ jgit clone "http://localhost:8080/test"
Cloning into 'test'...
remote: Counting objects: 1
remote: Finding sources: 100% (13/13)
Receiving objects:      100% (13/13)
Checking out files:     100% (3/3)

$ cd test
$ git log --oneline --graph
* cda23c9 (HEAD -> main, origin/main) test
* 1ddfebc (origin/master) b
* 80f45ce a
* f2894c2 Initial empty repository

-Matthias

Back to the top