github.com/andrewrech/lazygit@v0.8.1/pkg/git/testdata/testPatchAfter4.diff (about)

     1  diff --git a/pkg/git/patch_modifier.go b/pkg/git/patch_modifier.go
     2  index a8fc600..6d8f7d7 100644
     3  --- a/pkg/git/patch_modifier.go
     4  +++ b/pkg/git/patch_modifier.go
     5  @@ -124,13 +140,14 @@ func (p *PatchModifier) getModifiedHunk(patchLines []string, hunkStart int, line
     6   // @@ -14,8 +14,9 @@ import (
     7   func (p *PatchModifier) updatedHeader(currentHeader string, lineChanges int) (string, error) {
     8   	// current counter is the number after the second comma
     9   	re := regexp.MustCompile(`^[^,]+,[^,]+,(\d+)`)
    10   	matches := re.FindStringSubmatch(currentHeader)
    11   	if len(matches) < 2 {
    12   		re = regexp.MustCompile(`^[^,]+,[^+]+\+(\d+)`)
    13   		matches = re.FindStringSubmatch(currentHeader)
    14   	}
    15   	prevLengthString := matches[1]
    16  +	prevLengthString := re.FindStringSubmatch(currentHeader)[1]
    17   
    18   	prevLength, err := strconv.Atoi(prevLengthString)
    19   	if err != nil {