update to go-git v6.0.0-alpha.3 · Entire

update to go-git v6.0.0-alpha.3

130486f→main·Soph·2mo ago·18 files·+116 added/-155 removed

Sessions

6857343fdac4View transcript

Changes

18

226 unmodified lines

227
228
229
230
230
231
232
233
234
235
236
236
237
238
239

226 unmodified lines

defer r.Body.Close()

if !bytes.Contains(body, []byte("PACK")) {
        req := packp.NewUpdateRequests()
        req := &packp.UpdateRequests{}
        if err := req.Decode(bytes.NewReader(body)); err != nil {
            http.Error(w, err.Error(), http.StatusBadRequest)
            return
        }

report := packp.NewReportStatus()
        report := &packp.ReportStatus{}
        report.UnpackStatus = "ok"
        for _, cmd := range req.Commands {
            status := "ok"

Mclient_test.go+2/-2

22 unmodified lines

23
24
25
26
26
27
28
29
777 unmodified lines

807
808
809
810
810
811
812
812
813
814
815
6 unmodified lines

822
823
824
825
825
826
827
828
829
829
830
831
832
33 unmodified lines

866
867
868
869
869
870
871
872

22 unmodified lines

"github.com/go-git/go-git/v6/plumbing/format/pktline"
    "github.com/go-git/go-git/v6/plumbing/object"
    "github.com/go-git/go-git/v6/plumbing/protocol/packp"
    "github.com/go-git/go-git/v6/plumbing/protocol/packp/capability"
    "github.com/go-git/go-git/v6/plumbing/protocol/capability"
    "github.com/go-git/go-git/v6/plumbing/protocol/packp/sideband"
    "github.com/go-git/go-git/v6/plumbing/transport"
    "github.com/go-git/go-git/v6/storage/memory"
777 unmodified lines

}

func rewriteReceivePackAdvertisement(data []byte, mutate func(*capability.List)) ([]byte, error) {
    ar := packp.NewAdvRefs()
    ar := &packp.AdvRefs{}
    if err := ar.Decode(bytes.NewReader(data)); err == nil {
        mutate(ar.Capabilities)
        mutate(&ar.Capabilities)
        var buf bytes.Buffer
        if err := ar.Encode(&buf); err != nil {
            return nil, err
6 unmodified lines

}

if err := smart.Decode(rd); err != nil {
    return nil, err
}
ar = packp.NewAdvRefs()
ar = &packp.AdvRefs{}
if err := ar.Decode(rd); err != nil {
    return nil, err
}
mutate(ar.Capabilities)
mutate(&ar.Capabilities)
var buf bytes.Buffer
if err := smart.Encode(&buf); err != nil {
    return nil, err
33 unmodified lines

http.Error(w, err.Error(), http.StatusBadRequest)
    return
}

Mcmd/git-sync/main_test.go+6/-6

3 unmodified lines

4 5 6 7 7 8 9 10 11 unmodified lines

22 23 24 25 25 26 27 28

3 unmodified lines

require ( github.com/go-git/go-billy/v6 v6.0.0-alpha.1 github.com/go-git/go-git/v6 v6.0.0-alpha.2 github.com/go-git/go-git/v6 v6.0.0-alpha.3 github.com/spf13/cobra v1.10.2 github.com/stretchr/testify v1.11.1 github.com/zalando/go-keyring v0.2.8 11 unmodified lines

github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/kevinburke/ssh_config v1.6.0 // indirect github.com/klauspost/cpuid/v2 v2.3.0 // indirect github.com/pjbgf/sha1cd v0.5.0 // indirect github.com/pjbgf/sha1cd v0.6.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/sergi/go-diff v1.4.0 // indirect github.com/spf13/pflag v1.0.9 // indirect ``

Mgo.mod+2/-2

23 unmodified lines

24
25
26
27
28
29
30
31
32
33
34
9 unmodified lines

44
45
46
47
48
49
50
51

23 unmodified lines

github.com/go-git/go-billy/v6 v6.0.0-alpha.1/go.mod h1:eaCUpHbedW7//EwcYmUDfJe2N6sJC9O12AT0OTqJR1E=
github.com/go-git/go-git-fixtures/v6 v6.0.0-20260405195209-b16dd39735e0 h1:XoTsdvaghuVfIr7HpNTmFDLu2nz3I2iGqyn6Uk6MkJc=
github.com/go-git/go-git-fixtures/v6 v6.0.0-20260405195209-b16dd39735e0/go.mod h1:1Lr7/vYEYyl6Ir9Ku0tKrCIRreM5zovv0Jdx2MPSM4s=
github.com/go-git/go-git-fixtures/v6 v6.0.0-20260422085740-0c07409f52ec h1:FpCNUs50xfQyJJs31uO3mDnqU855OhzAzfkkTgE6/DI=
github.com/go-git/go-git/v6 v6.0.0-alpha.2 h1:T3loNtDuAixNzXtlQxZhnYiYpaQ3CA4vn9RssAniEeI=
github.com/go-git/go-git/v6 v6.0.0-alpha.2/go.mod h1:oCD3i19CTz7gBpeb11ZZqL91WzqbMq9avn5KpUYy/Ak=
github.com/go-git/go-git/v6 v6.0.0-alpha.3 h1:lJGritJ5AcC0X7buV0lReZ4cEHqcKB3Ab2ZjD3Ku+Ss=
github.com/go-git/go-git/v6 v6.0.0-alpha.3/go.mod h1:DGnqu+twdAgtDx/4tQTWFrVE1an+2ACph3W9yOfSJZM=
github.com/godbus/dbus/v5 v5.2.2 h1:TUR3TgtSVDmjiXOgAAyaZbYmIeP3DPkld3jgKGV8mXQ=
github.com/godbus/dbus/v5 v5.2.2/go.mod h1:3AAv2+hPq5rdnr5txxxRwiGjPXamgoIHgz9FPBfOp3c=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
9 unmodified lines

github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/pjbgf/sha1cd v0.5.0 h1:a+UkboSi1znleCDUNT3M5YxjOnN1fz2FhN48FlwCxs0=
github.com/pjbgf/sha1cd v0.5.0/go.mod h1:lhpGlyHLpQZoxMv8HcgXvZEhcGs0PG/vsZnEJ7H0iCM=
github.com/pjbgf/sha1cd v0.6.0 h1:3WJ8Wz8gvDz29quX1OcEmkAlUg9diU4GxJHqs0/XiwU=
github.com/pjbgf/sha1cd v0.6.0/go.mod h1:lhpGlyHLpQZoxMv8HcgXvZEhcGs0PG/vsZnEJ7H0iCM=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
``

Mgo.sum+5

5 unmodified lines

6 7 8 9 9 10 11 12

5 unmodified lines

"sort" "strings"

"github.com/go-git/go-git/v6/plumbing/protocol/packp/capability" "github.com/go-git/go-git/v6/plumbing/protocol/capability"

// V2Capabilities represents a parsed protocol v2 capability advertisement.


Minternal/gitproto/capability.go+1/-1

2 unmodified lines

3 4 5 6 7 6 7 8 9 134 unmodified lines

144 145 146 148 147 148 150 149 150 151 152

2 unmodified lines

import ( "testing"

"github.com/go-git/go-git/v6/plumbing/protocol/packp/capability" "github.com/stretchr/testify/require" "github.com/go-git/go-git/v6/plumbing/protocol/capability" )

func TestV2CapabilitiesFetchSupports(t *testing.T) { 134 unmodified lines

for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { list := capability.NewList() list := &capability.List{} for _, c := range tt.caps { require.NoError(t, list.Set(c)) list.Set(c) } got := PreferredSideband(list) if got != tt.want {