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

doc: clarify return values of Pull/Fetch. #205

Merged
merged 1 commit into from
Jan 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ func (r *Remote) String() string {
}

// Fetch fetches references from the remote to the local repository.
// Returns nil if the operation is successful, NoErrAlreadyUpToDate if there are
// no changes to be fetched, or an error.
func (r *Remote) Fetch(o *FetchOptions) error {
_, err := r.fetch(o)
return err
Expand Down
6 changes: 5 additions & 1 deletion repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,9 @@ func (r *Repository) IsEmpty() (bool, error) {
})
}

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

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