Fast implementation of Git in pure Go codeberg.org/lindenii/furgit
git go
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

*: Fix lints

Runxi Yu ab174c47 5942e587

+14 -6
+1 -1
network/receivepack/service/execute.go
··· 15 15 result := &Result{ 16 16 Commands: make([]CommandResult, 0, len(req.Commands)), 17 17 } 18 + 18 19 var err error 19 20 20 21 quarantine, ok := service.ingestQuarantine(result, req.Commands, req) ··· 88 89 return result, nil 89 90 } 90 91 91 - quarantine = nil 92 92 utils.BestEffortFprintf(service.opts.Progress, "promoting quarantine: done.\n") 93 93 } 94 94
+11 -3
object/store/dual/dual_test.go
··· 76 76 t.Helper() 77 77 78 78 meta := fixtureMetadata(t, algo) 79 + 79 80 hex, ok := meta[key] 80 81 if !ok { 81 82 t.Fatalf("missing fixture metadata key %q", key) ··· 93 94 t.Helper() 94 95 95 96 objectsRoot := repo.OpenObjectsRoot(t) 97 + 96 98 looseStore, err := loose.New(objectsRoot, algo) 97 99 if err != nil { 98 100 t.Fatalf("loose.New: %v", err) 99 101 } 100 102 101 103 packRoot := repo.OpenPackRoot(t) 104 + 102 105 packedStore, err := packed.New(packRoot, algo, packed.Options{WriteRev: true}) 103 106 if err != nil { 104 107 t.Fatalf("packed.New: %v", err) ··· 110 113 func TestDualReadsWritesAndQuarantine(t *testing.T) { 111 114 t.Parallel() 112 115 113 - testgit.ForEachAlgorithm(t, func(t *testing.T, algo objectid.Algorithm) { 116 + testgit.ForEachAlgorithm(t, func(t *testing.T, algo objectid.Algorithm) { //nolint:thelper 114 117 head := fixtureOID(t, algo, "head") 115 118 packBytes := fixtureBytes(t, algo, "nonthin.pack") 116 119 ··· 138 141 } 139 142 140 143 looseContent := []byte("dual quarantine loose object\n") 144 + 141 145 looseID, err := objectQ.WriteBytesContent(objecttype.TypeBlob, looseContent) 142 146 if err != nil { 143 147 t.Fatalf("quarantine.WriteBytesContent: %v", err) ··· 212 216 func TestDualQuarantineDiscardDropsBothHalves(t *testing.T) { 213 217 t.Parallel() 214 218 215 - testgit.ForEachAlgorithm(t, func(t *testing.T, algo objectid.Algorithm) { 219 + testgit.ForEachAlgorithm(t, func(t *testing.T, algo objectid.Algorithm) { //nolint:thelper 216 220 head := fixtureOID(t, algo, "head") 217 221 packBytes := fixtureBytes(t, algo, "nonthin.pack") 218 222 219 223 repo := testgit.NewRepo(t, testgit.RepoOptions{ObjectFormat: algo, Bare: true}) 220 224 store := newDualStore(t, repo, algo) 221 225 222 - quarantiner := any(store).(objectstore.Quarantiner) 226 + quarantiner, ok := any(store).(objectstore.Quarantiner) 227 + if !ok { 228 + t.Fatal("expected objectstore.Quarantiner") 229 + } 230 + 223 231 quarantine, err := quarantiner.BeginQuarantine(objectstore.QuarantineOptions{}) 224 232 if err != nil { 225 233 t.Fatalf("BeginQuarantine: %v", err)
+2 -2
object/store/quarantine.go
··· 1 1 package objectstore 2 2 3 - // WriterQuarantine represents one quarantined write that accepts both object- 3 + // Quarantine represents one quarantined write that accepts both object- 4 4 // wise and pack-wise writes. 5 5 type Quarantine interface { 6 6 BaseQuarantine ··· 13 13 Pack PackQuarantineOptions 14 14 } 15 15 16 - // WriterQuarantiner creates coordinated quarantines that support both object- 16 + // Quarantiner creates coordinated quarantines that support both object- 17 17 // wise and pack-wise writes. 18 18 type Quarantiner interface { 19 19 BeginQuarantine(opts QuarantineOptions) (Quarantine, error)