Handle Option<Hash> better
Dependencies
- [2]
EVHNGDT7parse FileAdd hunk - [3]
PHRWK7NKParse change headers - [4]
4JWXOJIPParse dependencies - [5]
7VEHGTEYSwitch from reading text format to reading binary format.
Change contents
- replacement in hunk.go at line 34
Change HashChange OptionalHash - replacement in hunk.go at line 38
func optionalHash(data []byte) ([]byte, Hash, error) {type OptionalHash struct {Valid boolHash}func (h OptionalHash) String() string {if !h.Valid {return "None"}return fmt.Sprintf("Some(%s)", h.Hash.String())}func optionalHash(data []byte) ([]byte, OptionalHash, error) { - replacement in hunk.go at line 53
return data, Hash{}, errreturn data, OptionalHash{}, err - replacement in hunk.go at line 56
return data, Hash{}, nilreturn data, OptionalHash{}, nil - replacement in hunk.go at line 58
return data, *hp, nilreturn data, OptionalHash{true, *hp}, nil - replacement in hunk.go at line 75
IntroducedBy HashIntroducedBy OptionalHash - replacement in hunk.go at line 91
Change HashChange OptionalHash - edit in go.sum at line 1
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= - replacement in go.mod at line 10
require github.com/klausman/hexdump v1.0.0 // indirect[2.4336]require (github.com/davecgh/go-spew v1.1.1 // indirectgithub.com/klausman/hexdump v1.0.0 // indirect) - edit in change_test.go at line 8
"github.com/davecgh/go-spew/spew" - replacement in change_test.go at line 32
Change: Hash{0xe7, 0x82, 0xb1, 0xd7, 0xe4, 0x17, 0x64, 0xe4, 0xfe, 0x45, 0x2d, 0x6f, 0x24, 0x22, 0x40, 0x26, 0x16, 0x12, 0xb7, 0x0f, 0x42, 0x70, 0xd9, 0xac, 0xd8, 0x4e, 0x5a, 0x82, 0xea, 0x85, 0xab, 0x57},Change: OptionalHash{true, Hash{0xe7, 0x82, 0xb1, 0xd7, 0xe4, 0x17, 0x64, 0xe4, 0xfe, 0x45, 0x2d, 0x6f, 0x24, 0x22, 0x40, 0x26, 0x16, 0x12, 0xb7, 0x0f, 0x42, 0x70, 0xd9, 0xac, 0xd8, 0x4e, 0x5a, 0x82, 0xea, 0x85, 0xab, 0x57}}, - replacement in change_test.go at line 41
Change: Hash{},Change: OptionalHash{true, Hash{}}, - replacement in change_test.go at line 48
Change: Hash{},Change: OptionalHash{}, - replacement in change_test.go at line 57
Change: Hash{},Change: OptionalHash{true, Hash{}}, - replacement in change_test.go at line 64
Change: Hash{},Change: OptionalHash{}, - replacement in change_test.go at line 73
Change: Hash{},Change: OptionalHash{}, - replacement in change_test.go at line 90
t.Fatalf("got %#v, want %#v", c, CB7A3P_golden)t.Fatalf("got %s, want %s", spew.Sdump(c), spew.Sdump(CB7A3P_golden)) - edit in change.go at line 32
if h == (Hash{}) {return ""}