Skip to content

Commit ebc56f9

Browse files
authored
Merge pull request #1634 from sashamelentyev/cleanup
utils: rm redundant dep and cleanup
2 parents 9bda2a0 + af4d494 commit ebc56f9

File tree

7 files changed

+5
-42
lines changed

7 files changed

+5
-42
lines changed

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ require (
2222
github.com/sergi/go-diff v1.4.0
2323
github.com/stretchr/testify v1.11.1
2424
golang.org/x/crypto v0.41.0
25-
golang.org/x/exp v0.0.0-20250531010427-b6e5de432a8b
2625
golang.org/x/net v0.43.0
2726
golang.org/x/sys v0.35.0
2827
golang.org/x/text v0.28.0

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu
5858
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
5959
golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4=
6060
golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc=
61-
golang.org/x/exp v0.0.0-20250531010427-b6e5de432a8b h1:QoALfVG9rhQ/M7vYDScfPdWjGL9dlsVVM5VGh7aKoAA=
62-
golang.org/x/exp v0.0.0-20250531010427-b6e5de432a8b/go.mod h1:U6Lno4MTRCDY+Ba7aCcauB9T60gsv5s4ralQzP72ZoQ=
6361
golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE=
6462
golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg=
6563
golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI=

plumbing/format/packfile/packfile.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"crypto"
55
"fmt"
66
"io"
7-
"os"
87
"sync"
98

109
billy "github.com/go-git/go-billy/v6"
@@ -349,8 +348,3 @@ func (p *Packfile) getMemoryObject(oh *ObjectHeader) (plumbing.EncodedObject, er
349348

350349
return obj, nil
351350
}
352-
353-
// errInvalidWindows is the Windows equivalent to os.ErrInvalid
354-
const errInvalidWindows = "The parameter is incorrect."
355-
356-
var errInvalidUnix = os.ErrInvalid.Error()

plumbing/format/packfile/parser_cache.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"slices"
55

66
"github.com/go-git/go-git/v6/plumbing"
7-
"golang.org/x/exp/maps"
87
)
98

109
func newParserCache() *parserCache {
@@ -36,7 +35,7 @@ func (c *parserCache) Reset(n int) {
3635
c.oi = c.oi[:0]
3736
c.oi = slices.Grow(c.oi, n)
3837

39-
maps.Clear(c.oiByHash)
40-
maps.Clear(c.oiByOffset)
38+
clear(c.oiByHash)
39+
clear(c.oiByOffset)
4140
}
4241
}

remote.go

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import (
1919
"github.com/go-git/go-git/v6/plumbing/object"
2020
"github.com/go-git/go-git/v6/plumbing/protocol/packp"
2121
"github.com/go-git/go-git/v6/plumbing/protocol/packp/capability"
22-
"github.com/go-git/go-git/v6/plumbing/protocol/packp/sideband"
2322
"github.com/go-git/go-git/v6/plumbing/revlist"
2423
"github.com/go-git/go-git/v6/plumbing/storer"
2524
"github.com/go-git/go-git/v6/plumbing/transport"
@@ -1091,24 +1090,6 @@ func (r *Remote) isSupportedRefSpec(refs []config.RefSpec, caps *capability.List
10911090
return ErrExactSHA1NotSupported
10921091
}
10931092

1094-
func buildSidebandIfSupported(l *capability.List, reader io.Reader, p sideband.Progress) io.Reader {
1095-
var t sideband.Type
1096-
1097-
switch {
1098-
case l.Supports(capability.Sideband):
1099-
t = sideband.Sideband
1100-
case l.Supports(capability.Sideband64k):
1101-
t = sideband.Sideband64k
1102-
default:
1103-
return reader
1104-
}
1105-
1106-
d := sideband.NewDemuxer(t, reader)
1107-
d.Progress = p
1108-
1109-
return d
1110-
}
1111-
11121093
func (r *Remote) updateLocalReferenceStorage(
11131094
specs []config.RefSpec,
11141095
fetchedRefs, remoteRefs memory.ReferenceStorage,

storage/filesystem/object.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -464,13 +464,6 @@ func (s *ObjectStorage) getFromUnpacked(h plumbing.Hash) (obj plumbing.EncodedOb
464464
return obj, nil
465465
}
466466

467-
var copyBufferPool = sync.Pool{
468-
New: func() interface{} {
469-
b := make([]byte, 32*1024)
470-
return &b
471-
},
472-
}
473-
474467
// Get returns the object with the given hash, by searching for it in
475468
// the packfile.
476469
func (s *ObjectStorage) getFromPackfile(h plumbing.Hash, canBeDelta bool) (plumbing.EncodedObject, error) {

utils/ioutil/context_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ package ioutil
22

33
import (
44
"bytes"
5+
"context"
56
"io"
67
"testing"
78
"time"
8-
9-
context "golang.org/x/net/context"
109
)
1110

1211
func TestReader(t *testing.T) {
@@ -60,7 +59,7 @@ func TestWriter(t *testing.T) {
6059
if err != nil {
6160
t.Error("should have no error")
6261
}
63-
if string(buf.Bytes()) != string("abc") {
62+
if buf.String() != "abc" {
6463
t.Error("incorrect contents")
6564
}
6665

@@ -72,7 +71,7 @@ func TestWriter(t *testing.T) {
7271
if err != nil {
7372
t.Error("should have no error")
7473
}
75-
if string(buf.Bytes()) != string("abcdef") {
74+
if buf.String() != "abcdef" {
7675
t.Error("incorrect contents")
7776
}
7877
}

0 commit comments

Comments
 (0)