Skip to content
This repository was 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
@EmrysMyrddin EmrysMyrddin force-pushed the feature/export-new-remote branch from b7b9861 to 64665fd Compare May 6, 2019 07:36
@@ -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

@EmrysMyrddin EmrysMyrddin force-pushed the feature/export-new-remote branch from 64665fd to 8e8e913 Compare June 17, 2019 20:28
@EmrysMyrddin EmrysMyrddin force-pushed the feature/export-new-remote branch from 8e8e913 to b4fba7e Compare June 17, 2019 20:51
@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