fork of go-git with some jj specific features
fork

Configure Feed

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

plumbing: packfile parser process deltaRef before deltaObj in thin pack

+4 -5
+3 -4
plumbing/format/packfile/parser.go
··· 117 117 118 118 case ObjectSection: 119 119 oh := data.Value().(ObjectHeader) 120 - 121 120 if oh.Type.IsDelta() { 122 121 if oh.Type == plumbing.OFSDeltaObject { 123 122 pendingDeltas = append(pendingDeltas, &oh) ··· 138 137 return plumbing.ZeroHash, ErrEmptyPackfile 139 138 } 140 139 141 - for _, oh := range pendingDeltas { 140 + for _, oh := range pendingDeltaREFs { 142 141 err := p.processDelta(oh) 143 142 if err != nil { 144 143 return plumbing.ZeroHash, err 145 144 } 146 145 } 147 146 148 - for _, oh := range pendingDeltaREFs { 147 + for _, oh := range pendingDeltas { 149 148 err := p.processDelta(oh) 150 149 if err != nil { 151 150 return plumbing.ZeroHash, err ··· 248 247 // If the parent is not an external ref and we don't have the 249 248 // content offset, we won't be able to inflate via seeking through 250 249 // the packfile. 251 - if parent.externalRef && parent.ContentOffset == 0 { 250 + if !parent.externalRef && parent.ContentOffset == 0 { 252 251 return nil, plumbing.ErrObjectNotFound 253 252 } 254 253
+1 -1
plumbing/format/packfile/parser_test.go
··· 98 98 assert.NoError(t, err) 99 99 100 100 _, err = parser.Parse() 101 - assert.Equal(t, err, plumbing.ErrObjectNotFound) 101 + assert.Equal(t, err, packfile.ErrReferenceDeltaNotFound) 102 102 103 103 // start over with a clean repo 104 104 r, err = git.PlainInit(t.TempDir(), true)