Skip to content

Commit e626226

Browse files
authored
Merge pull request go-git#123 from cristaloleg/check-err-fix
*: skip error check explicitly
2 parents 58ac863 + d872dd9 commit e626226

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

remote.go

+6-4
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,9 @@ func (r *Remote) newReferenceUpdateRequest(
218218
if o.Progress != nil {
219219
req.Progress = o.Progress
220220
if ar.Capabilities.Supports(capability.Sideband64k) {
221-
req.Capabilities.Set(capability.Sideband64k)
221+
_ = req.Capabilities.Set(capability.Sideband64k)
222222
} else if ar.Capabilities.Supports(capability.Sideband) {
223-
req.Capabilities.Set(capability.Sideband)
223+
_ = req.Capabilities.Set(capability.Sideband)
224224
}
225225
}
226226

@@ -1037,11 +1037,13 @@ func (r *Remote) List(o *ListOptions) (rfs []*plumbing.Reference, err error) {
10371037
}
10381038

10391039
var resultRefs []*plumbing.Reference
1040-
refs.ForEach(func(ref *plumbing.Reference) error {
1040+
err = refs.ForEach(func(ref *plumbing.Reference) error {
10411041
resultRefs = append(resultRefs, ref)
10421042
return nil
10431043
})
1044-
1044+
if err != nil {
1045+
return nil, err
1046+
}
10451047
return resultRefs, nil
10461048
}
10471049

repository.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func Init(s storage.Storer, worktree billy.Filesystem) (*Repository, error) {
9292
}
9393

9494
if worktree == nil {
95-
r.setIsBare(true)
95+
_ = r.setIsBare(true)
9696
return r, nil
9797
}
9898

@@ -408,7 +408,7 @@ func PlainCloneContext(ctx context.Context, path string, isBare bool, o *CloneOp
408408
err = r.clone(ctx, o)
409409
if err != nil && err != ErrRepositoryAlreadyExists {
410410
if cleanup {
411-
cleanUpDir(path, cleanupParent)
411+
_ = cleanUpDir(path, cleanupParent)
412412
}
413413
}
414414

0 commit comments

Comments
 (0)