Update code.gitea.io/git (#3482)

This commit is contained in:
Ethan Koenig 2018-02-10 10:19:26 -08:00 committed by Lauris BH
parent 58771acacb
commit 6eaeb01ecf
5 changed files with 108 additions and 126 deletions

View file

@ -14,6 +14,7 @@ import (
"io/ioutil"
"os"
"os/exec"
"strconv"
"strings"
"code.gitea.io/git"
@ -368,8 +369,15 @@ func ParsePatch(maxLines, maxLineCharacters, maxFiles int, reader io.Reader) (*D
a := line[beg+2 : middle]
b := line[middle+3:]
if hasQuote {
a = string(git.UnescapeChars([]byte(a[1 : len(a)-1])))
b = string(git.UnescapeChars([]byte(b[1 : len(b)-1])))
var err error
a, err = strconv.Unquote(a)
if err != nil {
return nil, fmt.Errorf("Unquote: %v", err)
}
b, err = strconv.Unquote(b)
if err != nil {
return nil, fmt.Errorf("Unquote: %v", err)
}
}
curFile = &DiffFile{