Skip to content
This repository has been archived by the owner on Sep 11, 2020. It is now read-only.

git : allows to create a Remote without a Repository #1142

Merged
merged 1 commit into from
Jun 18, 2019

Conversation

EmrysMyrddin
Copy link
Contributor

Git has the ls-remote command which allows to remotely retrieve the list of references.

We want to use it to list remote tags without cloning the entire repository for example.

To implement the same behaviour with go-git we need to create a Remote structure by hand and use the List function.

I have added a runnable example which prints out the list of tags of a sample repository.

@EmrysMyrddin EmrysMyrddin force-pushed the feature/export-new-remote branch 3 times, most recently from 2df8e2a to 2cc8d82 Compare May 3, 2019 12:24
_examples/ls-remote/main.go Outdated Show resolved Hide resolved
_examples/ls-remote/main.go Outdated Show resolved Hide resolved
_examples/ls-remote/main.go Outdated Show resolved Hide resolved
remote.go Show resolved Hide resolved
@@ -45,7 +45,7 @@ type Remote struct {
s storage.Storer
}

func newRemote(s storage.Storer, c *config.RemoteConfig) *Remote {
func NewRemote(s storage.Storer, c *config.RemoteConfig) *Remote {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you document the new exported function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry for the late response, I have added the documentation

Signed-off-by: Valentin Cocaud <v.cocaud@gmail.com>
@mcuadros mcuadros merged commit f9a3019 into src-d:master Jun 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants