fork of go-gitdiff with jj support
fork

Configure Feed

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

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

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