Update src-d/go-git to v4.13.0 (#7688)

* update gopkg.in/src-d/go-git.v4 v4.13.0

* mod tidy

* vendor
This commit is contained in:
Antoine GIRARD 2019-07-31 18:45:42 +02:00 committed by techknowlogick
parent bb875e98a1
commit a9b4c8171f
131 changed files with 3148 additions and 406 deletions

View file

@ -1,22 +1,22 @@
package ssh_config
import (
"io"
buffruneio "github.com/pelletier/go-buffruneio"
"bytes"
)
// Define state functions
type sshLexStateFn func() sshLexStateFn
type sshLexer struct {
input *buffruneio.Reader // Textual source
buffer []rune // Runes composing the current token
inputIdx int
input []rune // Textual source
buffer []rune // Runes composing the current token
tokens chan token
line uint32
col uint16
endbufferLine uint32
endbufferCol uint16
line int
col int
endbufferLine int
endbufferCol int
}
func (s *sshLexer) lexComment(previousState sshLexStateFn) sshLexStateFn {
@ -114,16 +114,14 @@ func (s *sshLexer) lexRvalue() sshLexStateFn {
}
func (s *sshLexer) read() rune {
r, _, err := s.input.ReadRune()
if err != nil {
panic(err)
}
r := s.peek()
if r == '\n' {
s.endbufferLine++
s.endbufferCol = 1
} else {
s.endbufferCol++
}
s.inputIdx++
return r
}
@ -197,21 +195,22 @@ func (s *sshLexer) emitWithValue(t tokenType, value string) {
}
func (s *sshLexer) peek() rune {
r, _, err := s.input.ReadRune()
if err != nil {
panic(err)
if s.inputIdx >= len(s.input) {
return eof
}
s.input.UnreadRune()
r := s.input[s.inputIdx]
return r
}
func (s *sshLexer) follow(next string) bool {
inputIdx := s.inputIdx
for _, expectedRune := range next {
r, _, err := s.input.ReadRune()
defer s.input.UnreadRune()
if err != nil {
panic(err)
if inputIdx >= len(s.input) {
return false
}
r := s.input[inputIdx]
inputIdx++
if expectedRune != r {
return false
}
@ -226,10 +225,10 @@ func (s *sshLexer) run() {
close(s.tokens)
}
func lexSSH(input io.Reader) chan token {
bufferedInput := buffruneio.NewReader(input)
func lexSSH(input []byte) chan token {
runes := bytes.Runes(input)
l := &sshLexer{
input: bufferedInput,
input: runes,
tokens: make(chan token),
line: 1,
col: 1,