mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-21 00:30:00 +02:00
Bump go-git
This commit is contained in:
go.modgo.summodules.txt
vendor
dario.cat
mergo
github.com
Microsoft
go-winio
ProtonMail
go-crypto
AUTHORSCONTRIBUTORSLICENSEPATENTSkey_generation.gokeys.gokeys_test_data.go
bitcurves
brainpool
eax
internal
byteutil
ocb
openpgp
aes
keywrap
armor
canonical_text.goecdh
ecdsa
ed25519
ed448
eddsa
elgamal
errors
hash.gointernal
algorithm
ecc
encoding
packet
aead_config.goaead_crypter.goaead_encrypted.gocompressed.goconfig.goconfig_v5.goencrypted_key.goliteral.gomarker.gonotation.goocfb.goone_pass_signature.goopaque.gopacket.gopacket_sequence.gopacket_unsupported.gopadding.goprivate_key.goprivate_key_test_data.gopublic_key.gopublic_key_test_data.goreader.gorecipient.gosignature.gosymmetric_key_encrypted.gosymmetrically_encrypted.gosymmetrically_encrypted_aead.gosymmetrically_encrypted_mdc.gouserattribute.gouserid.go
read.goread_write_test_data.gos2k
write.gox25519
x448
cloudflare
circl
LICENSE
dh
x25519
x448
ecc
goldilocks
internal
conv
sha3
math
sign
cyphar
filepath-securejoin
emirpasic
gods
containers
lists
trees
utils
go-git
gcfg
go-billy
golang
jesseduffield
go-git
v5
.gitignoreCOMPATIBILITY.mdCONTRIBUTING.mdEXTENDING.mdMakefileREADME.mdSECURITY.mdblame.gocommon.gohash.goreference.goprune.goreferences.goremote.gorepository.gosigner.gostatus.goworktree.goworktree_bsd.goworktree_commit.goworktree_js.goworktree_linux.goworktree_status.goworktree_unix_other.go
config
internal
object_walker.gooptions.gooss-fuzz.shplumbing
filemode
format
config
diff
gitignore
idxfile
index
objfile
packfile
common.godelta_index.godiff_delta.goencoder.gofsobject.gopackfile.goparser.gopatch_delta.goscanner.go
pktline
hash
memory.goobject.goobject
change.gochange_adaptor.gocommit.gocommit_walker_path.gocommon.gopatch.gorename.gosignature.gotag.gotree.gotreenoder.go
protocol
packp
storer
transport
storage
submodule.goutils
binary
ioutil
merkletrie
sync
trace
kevinburke
konsorten
go-windows-terminal-sequences
mitchellh
go-homedir
pjbgf
sha1cd
sergi
go-diff
diffmatchpatch
sirupsen
logrus
skeema
stretchr
testify
xanzy
golang.org
x
crypto
argon2
blake2b
blake2b.goblake2bAVX2_amd64.goblake2bAVX2_amd64.sblake2b_amd64.sblake2b_generic.goblake2b_ref.goblake2x.goregister.go
cryptobyte
hkdf
internal
openpgp
errors
keys.gopacket
config.goencrypted_key.goone_pass_signature.gopacket.goprivate_key.gopublic_key.gopublic_key_v3.goreader.gosignature.gosignature_v3.gosymmetric_key_encrypted.go
read.gos2k
write.gosha3
doc.gohashes.gohashes_noasm.gokeccakf.gokeccakf_amd64.gokeccakf_amd64.ssha3.gosha3_s390x.gosha3_s390x.sshake.goshake_noasm.go
ssh
exp
net
sys
102
vendor/github.com/sergi/go-diff/diffmatchpatch/stringutil.go
generated
vendored
102
vendor/github.com/sergi/go-diff/diffmatchpatch/stringutil.go
generated
vendored
@ -9,10 +9,16 @@
|
||||
package diffmatchpatch
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"unicode/utf8"
|
||||
)
|
||||
|
||||
const UNICODE_INVALID_RANGE_START = 0xD800
|
||||
const UNICODE_INVALID_RANGE_END = 0xDFFF
|
||||
const UNICODE_INVALID_RANGE_DELTA = UNICODE_INVALID_RANGE_END - UNICODE_INVALID_RANGE_START + 1
|
||||
const UNICODE_RANGE_MAX = 0x10FFFF
|
||||
|
||||
// unescaper unescapes selected chars for compatibility with JavaScript's encodeURI.
|
||||
// In speed critical applications this could be dropped since the receiving application will certainly decode these fine. Note that this function is case-sensitive. Thus "%3F" would not be unescaped. But this is ok because it is only called with the output of HttpUtility.UrlEncode which returns lowercase hex. Example: "%3f" -> "?", "%24" -> "$", etc.
|
||||
var unescaper = strings.NewReplacer(
|
||||
@ -86,3 +92,99 @@ func runesIndex(r1, r2 []rune) int {
|
||||
}
|
||||
return -1
|
||||
}
|
||||
|
||||
func intArrayToString(ns []uint32) string {
|
||||
if len(ns) == 0 {
|
||||
return ""
|
||||
}
|
||||
|
||||
b := []rune{}
|
||||
for _, n := range ns {
|
||||
b = append(b, intToRune(n))
|
||||
}
|
||||
return string(b)
|
||||
}
|
||||
|
||||
// These constants define the number of bits representable
|
||||
// in 1,2,3,4 byte utf8 sequences, respectively.
|
||||
const ONE_BYTE_BITS = 7
|
||||
const TWO_BYTE_BITS = 11
|
||||
const THREE_BYTE_BITS = 16
|
||||
const FOUR_BYTE_BITS = 21
|
||||
|
||||
// Helper for getting a sequence of bits from an integer.
|
||||
func getBits(i uint32, cnt byte, from byte) byte {
|
||||
return byte((i >> from) & ((1 << cnt) - 1))
|
||||
}
|
||||
|
||||
// Converts an integer in the range 0~1112060 into a rune.
|
||||
// Based on the ranges table in https://en.wikipedia.org/wiki/UTF-8
|
||||
func intToRune(i uint32) rune {
|
||||
if i < (1 << ONE_BYTE_BITS) {
|
||||
return rune(i)
|
||||
}
|
||||
|
||||
if i < (1 << TWO_BYTE_BITS) {
|
||||
r, size := utf8.DecodeRune([]byte{0b11000000 | getBits(i, 5, 6), 0b10000000 | getBits(i, 6, 0)})
|
||||
if size != 2 || r == utf8.RuneError {
|
||||
panic(fmt.Sprintf("Error encoding an int %d with size 2, got rune %v and size %d", size, r, i))
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// Last -3 here needed because for some reason 3rd to last codepoint 65533 in this range
|
||||
// was returning utf8.RuneError during encoding.
|
||||
if i < ((1 << THREE_BYTE_BITS) - UNICODE_INVALID_RANGE_DELTA - 3) {
|
||||
if i >= UNICODE_INVALID_RANGE_START {
|
||||
i += UNICODE_INVALID_RANGE_DELTA
|
||||
}
|
||||
|
||||
r, size := utf8.DecodeRune([]byte{0b11100000 | getBits(i, 4, 12), 0b10000000 | getBits(i, 6, 6), 0b10000000 | getBits(i, 6, 0)})
|
||||
if size != 3 || r == utf8.RuneError {
|
||||
panic(fmt.Sprintf("Error encoding an int %d with size 3, got rune %v and size %d", size, r, i))
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
if i < (1<<FOUR_BYTE_BITS - UNICODE_INVALID_RANGE_DELTA - 3) {
|
||||
i += UNICODE_INVALID_RANGE_DELTA + 3
|
||||
r, size := utf8.DecodeRune([]byte{0b11110000 | getBits(i, 3, 18), 0b10000000 | getBits(i, 6, 12), 0b10000000 | getBits(i, 6, 6), 0b10000000 | getBits(i, 6, 0)})
|
||||
if size != 4 || r == utf8.RuneError {
|
||||
panic(fmt.Sprintf("Error encoding an int %d with size 4, got rune %v and size %d", size, r, i))
|
||||
}
|
||||
return r
|
||||
}
|
||||
panic(fmt.Sprintf("The integer %d is too large for runeToInt()", i))
|
||||
}
|
||||
|
||||
// Converts a rune generated by intToRune back to an integer
|
||||
func runeToInt(r rune) uint32 {
|
||||
i := uint32(r)
|
||||
if i < (1 << ONE_BYTE_BITS) {
|
||||
return i
|
||||
}
|
||||
|
||||
bytes := []byte{0, 0, 0, 0}
|
||||
|
||||
size := utf8.EncodeRune(bytes, r)
|
||||
|
||||
if size == 2 {
|
||||
return uint32(bytes[0]&0b11111)<<6 | uint32(bytes[1]&0b111111)
|
||||
}
|
||||
|
||||
if size == 3 {
|
||||
result := uint32(bytes[0]&0b1111)<<12 | uint32(bytes[1]&0b111111)<<6 | uint32(bytes[2]&0b111111)
|
||||
if result >= UNICODE_INVALID_RANGE_END {
|
||||
return result - UNICODE_INVALID_RANGE_DELTA
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
if size == 4 {
|
||||
result := uint32(bytes[0]&0b111)<<18 | uint32(bytes[1]&0b111111)<<12 | uint32(bytes[2]&0b111111)<<6 | uint32(bytes[3]&0b111111)
|
||||
return result - UNICODE_INVALID_RANGE_DELTA - 3
|
||||
}
|
||||
|
||||
panic(fmt.Sprintf("Unexpected state decoding rune=%v size=%d", r, size))
|
||||
}
|
||||
|
Reference in New Issue
Block a user