aboutsummaryrefslogtreecommitdiffstats
path: root/remote.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2020-07-16 21:29:58 +0200
committerGitHub <noreply@github.com>2020-07-16 21:29:58 +0200
commit641ee1dd69d3b8616127623e4b9341f4f4196d12 (patch)
treec37ce033ec64f0378acc2cde8ae59a54cdd74667 /remote.go
parent7906922c319b6077e8e66b70711073fb59a08a20 (diff)
parent8b8e4561eec882fad6e93d8e4257a9dc21311f3e (diff)
downloadgo-git-641ee1dd69d3b8616127623e4b9341f4f4196d12.tar.gz
Merge pull request #125 from cristaloleg/minor-linter-fixes
*: minor linter fixes
Diffstat (limited to 'remote.go')
-rw-r--r--remote.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/remote.go b/remote.go
index 2c5d806..39da24e 100644
--- a/remote.go
+++ b/remote.go
@@ -498,10 +498,8 @@ func (r *Remote) deleteReferences(rs config.RefSpec,
if _, ok := refsDict[rs.Dst(ref.Name()).String()]; ok {
return nil
}
- } else {
- if rs.Dst("") != ref.Name() {
- return nil
- }
+ } else if rs.Dst("") != ref.Name() {
+ return nil
}
cmd := &packp.Command{
@@ -1048,12 +1046,11 @@ func (r *Remote) List(o *ListOptions) (rfs []*plumbing.Reference, err error) {
}
func objectsToPush(commands []*packp.Command) []plumbing.Hash {
- var objects []plumbing.Hash
+ objects := make([]plumbing.Hash, 0, len(commands))
for _, cmd := range commands {
if cmd.New == plumbing.ZeroHash {
continue
}
-
objects = append(objects, cmd.New)
}
return objects