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

Commit b7b9861

Browse files
Update remote comments
Co-Authored-By: EmrysMyrddin <[email protected]>
1 parent 2cc8d82 commit b7b9861

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

_examples/ls-remote/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"gopkg.in/src-d/go-git.v4/storage/memory"
99
)
1010

11-
// Retreive remote tags without cloning repository
11+
// Retrieve remote tags without cloning repository
1212
func main() {
1313

1414
// Create the remote with repository URL
@@ -19,13 +19,13 @@ func main() {
1919

2020
log.Print("Fetching tags...")
2121

22-
// We can then use every Remote functions to retreive wanted informations
22+
// We can then use every Remote functions to retrieve wanted informations
2323
refs, err := rem.List(&git.ListOptions{})
2424
if err != nil {
2525
log.Fatal(err)
2626
}
2727

28-
// Filters the reference list and only keep tags
28+
// Filters the references list and only keeps tags
2929
var tags []string
3030
for _, ref := range refs {
3131
if ref.Name().IsTag() {

remote.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ type Remote struct {
4545
s storage.Storer
4646
}
4747

48+
// NewRemote creates a new Remote.
49+
// The intended purpose is to use the Remote for tasks such as listing remote references (like using git ls-remote).
50+
// Otherwise Remotes should be created via the use of a Repository.
4851
func NewRemote(s storage.Storer, c *config.RemoteConfig) *Remote {
4952
return &Remote{s: s, c: c}
5053
}

0 commit comments

Comments
 (0)