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

Commit 3343c11

Browse files
smolamcuadros
authored andcommitted
doc: clarify return values of Pull/Fetch. (#205)
1 parent 92d3de7 commit 3343c11

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

remote.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ func (r *Remote) String() string {
4646
}
4747

4848
// Fetch fetches references from the remote to the local repository.
49+
// Returns nil if the operation is successful, NoErrAlreadyUpToDate if there are
50+
// no changes to be fetched, or an error.
4951
func (r *Remote) Fetch(o *FetchOptions) error {
5052
_, err := r.fetch(o)
5153
return err

repository.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,9 @@ func (r *Repository) IsEmpty() (bool, error) {
306306
})
307307
}
308308

309-
// Pull incorporates changes from a remote repository into the current branch
309+
// Pull incorporates changes from a remote repository into the current branch.
310+
// Returns nil if the operation is successful, NoErrAlreadyUpToDate if there are
311+
// no changes to be fetched, or an error.
310312
func (r *Repository) Pull(o *PullOptions) error {
311313
if err := o.Validate(); err != nil {
312314
return err
@@ -333,6 +335,8 @@ func (r *Repository) Pull(o *PullOptions) error {
333335
}
334336

335337
// Fetch fetches changes from a remote repository.
338+
// Returns nil if the operation is successful, NoErrAlreadyUpToDate if there are
339+
// no changes to be fetched, or an error.
336340
func (r *Repository) Fetch(o *FetchOptions) error {
337341
if err := o.Validate(); err != nil {
338342
return err

0 commit comments

Comments
 (0)