fork of go-gitdiff with jj support

Test with Go 1.19, upgrade golangci-lint (#35)

The previous version of the golangci-lint action would install its own
version of Go, which eventually conflicted with the old pinned version
of the linter I was using. Upgrade the action to avoid this, but also
update Go and the linter while I'm here.

authored by Billy Keyes and committed by GitHub 071689e9 75930390

Changed files
+12 -14
.github
workflows
gitdiff
+5 -5
.github/workflows/go.yml
··· 9 9 name: Verify 10 10 runs-on: ubuntu-latest 11 11 steps: 12 - - name: Set up Go 1.16 13 - uses: actions/setup-go@v2 12 + - name: Set up Go 1.19 13 + uses: actions/setup-go@v3 14 14 with: 15 - go-version: 1.16 15 + go-version: 1.19 16 16 17 17 - name: Check out code into the Go module directory 18 18 uses: actions/checkout@v2 19 19 20 20 - name: Lint 21 - uses: golangci/golangci-lint-action@v2 21 + uses: golangci/golangci-lint-action@v3 22 22 with: 23 - version: v1.28 23 + version: v1.49 24 24 25 25 - name: Test 26 26 run: go test -v ./...
+3 -4
gitdiff/apply.go
··· 13 13 // Users can test if an error was caused by a conflict by using errors.Is with 14 14 // an empty Conflict: 15 15 // 16 - // if errors.Is(err, &Conflict{}) { 17 - // // handle conflict 18 - // } 19 - // 16 + // if errors.Is(err, &Conflict{}) { 17 + // // handle conflict 18 + // } 20 19 type Conflict struct { 21 20 msg string 22 21 }
+3 -3
gitdiff/apply_binary.go
··· 115 115 // readBinaryDeltaSize reads a variable length size from a delta-encoded binary 116 116 // fragment, returing the size and the unused data. Data is encoded as: 117 117 // 118 - // [[1xxxxxxx]...] [0xxxxxxx] 118 + // [[1xxxxxxx]...] [0xxxxxxx] 119 119 // 120 120 // in little-endian order, with 7 bits of the value per byte. 121 121 func readBinaryDeltaSize(d []byte) (size int64, rest []byte) { ··· 134 134 // fragment, returning the amount of data written and the usused part of the 135 135 // fragment. An add operation takes the form: 136 136 // 137 - // [0xxxxxx][[data1]...] 137 + // [0xxxxxx][[data1]...] 138 138 // 139 139 // where the lower seven bits of the opcode is the number of data bytes 140 140 // following the opcode. See also pack-format.txt in the Git source. ··· 151 151 // fragment, returing the amount of data written and the unused part of the 152 152 // fragment. A copy operation takes the form: 153 153 // 154 - // [1xxxxxxx][offset1][offset2][offset3][offset4][size1][size2][size3] 154 + // [1xxxxxxx][offset1][offset2][offset3][offset4][size1][size2][size3] 155 155 // 156 156 // where the lower seven bits of the opcode determine which non-zero offset and 157 157 // size bytes are present in little-endian order: if bit 0 is set, offset1 is
-1
gitdiff/apply_text.go
··· 10 10 // 11 11 // By default, TextApplier operates in "strict" mode, where fragment content 12 12 // and positions must exactly match those of the source. 13 - // 14 13 type TextApplier struct { 15 14 dst io.Writer 16 15 src io.ReaderAt
+1 -1
gitdiff/testdata/apply/bin.go
··· 1 - //+build ignore 1 + //go:build ignore 2 2 3 3 // bin.go is a helper CLI to manipulate binary diff data for testing purposes. 4 4 // It can decode patches generated by git using the standard parsing functions