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

Commit 6588614

Browse files
committed
remove unused result parameter from objectsToPush
It always returns a nil error. Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
1 parent 886dc83 commit 6588614

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

remote.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,7 @@ func (r *Remote) PushContext(ctx context.Context, o *PushOptions) error {
130130
return NoErrAlreadyUpToDate
131131
}
132132

133-
objects, err := objectsToPush(req.Commands)
134-
if err != nil {
135-
return err
136-
}
133+
objects := objectsToPush(req.Commands)
137134

138135
haves, err := referencesToHashes(remoteRefs)
139136
if err != nil {
@@ -907,7 +904,7 @@ func (r *Remote) List(o *ListOptions) ([]*plumbing.Reference, error) {
907904
return resultRefs, nil
908905
}
909906

910-
func objectsToPush(commands []*packp.Command) ([]plumbing.Hash, error) {
907+
func objectsToPush(commands []*packp.Command) []plumbing.Hash {
911908
var objects []plumbing.Hash
912909
for _, cmd := range commands {
913910
if cmd.New == plumbing.ZeroHash {
@@ -916,8 +913,7 @@ func objectsToPush(commands []*packp.Command) ([]plumbing.Hash, error) {
916913

917914
objects = append(objects, cmd.New)
918915
}
919-
920-
return objects, nil
916+
return objects
921917
}
922918

923919
func referencesToHashes(refs storer.ReferenceStorer) ([]plumbing.Hash, error) {

0 commit comments

Comments
 (0)