forked from forgejo/forgejo
update go git from v4.10.0 to v4.11.0 (#7096)
This commit is contained in:
parent
fb4438a815
commit
8a343dda39
15 changed files with 93 additions and 40 deletions
11
vendor/gopkg.in/src-d/go-git.v4/plumbing/object/patch.go
generated
vendored
11
vendor/gopkg.in/src-d/go-git.v4/plumbing/object/patch.go
generated
vendored
|
@ -320,11 +320,18 @@ func getFileStatsFromFilePatches(filePatches []fdiff.FilePatch) FileStats {
|
|||
}
|
||||
|
||||
for _, chunk := range fp.Chunks() {
|
||||
s := chunk.Content()
|
||||
switch chunk.Type() {
|
||||
case fdiff.Add:
|
||||
cs.Addition += strings.Count(chunk.Content(), "\n")
|
||||
cs.Addition += strings.Count(s, "\n")
|
||||
if s[len(s)-1] != '\n' {
|
||||
cs.Addition++
|
||||
}
|
||||
case fdiff.Delete:
|
||||
cs.Deletion += strings.Count(chunk.Content(), "\n")
|
||||
cs.Deletion += strings.Count(s, "\n")
|
||||
if s[len(s)-1] != '\n' {
|
||||
cs.Deletion++
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue