Fix wording, docs and style inconsistencies per audit of 0139564
This commit is contained in:
@@ -2,6 +2,7 @@ package git
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
@@ -148,7 +149,7 @@ func stats(ctx context.Context, dir, base, tree string) ([]api.FileChange, error
|
||||
f := api.FileChange{Status: status}
|
||||
if status == api.Renamed {
|
||||
if i+2 >= len(tokens) {
|
||||
return nil, fmt.Errorf("truncated rename in name-status output")
|
||||
return nil, errors.New("truncated rename in name-status output")
|
||||
}
|
||||
old := tokens[i+1]
|
||||
f.OldPath = &old
|
||||
@@ -156,7 +157,7 @@ func stats(ctx context.Context, dir, base, tree string) ([]api.FileChange, error
|
||||
i += 2
|
||||
} else {
|
||||
if i+1 >= len(tokens) {
|
||||
return nil, fmt.Errorf("truncated name-status output")
|
||||
return nil, errors.New("truncated name-status output")
|
||||
}
|
||||
f.Path = tokens[i+1]
|
||||
i++
|
||||
|
||||
Reference in New Issue
Block a user