Skip to content

Commit ba96e9f

Browse files
committed
fix test & lint
1 parent d786956 commit ba96e9f

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

services/gitdiff/gitdiff.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -533,13 +533,13 @@ parsingLoop:
533533
}
534534

535535
if maxFiles > -1 && len(diff.Files) >= maxFiles {
536-
lastFile := createDiffFile(diff, line)
536+
lastFile := createDiffFile(line)
537537
diff.End = lastFile.Name
538538
diff.IsIncomplete = true
539539
break parsingLoop
540540
}
541541

542-
curFile = createDiffFile(diff, line)
542+
curFile = createDiffFile(line)
543543
if skipping {
544544
if curFile.Name != skipToFile {
545545
line, err = skipToNextDiffHead(input)
@@ -1013,7 +1013,7 @@ func parseHunks(ctx context.Context, curFile *DiffFile, maxLines, maxLineCharact
10131013
}
10141014
}
10151015

1016-
func createDiffFile(diff *Diff, line string) *DiffFile {
1016+
func createDiffFile(line string) *DiffFile {
10171017
// The a/ and b/ filenames are the same unless rename/copy is involved.
10181018
// Especially, even for a creation or a deletion, /dev/null is not used
10191019
// in place of the a/ or b/ filenames.

services/repository/files/diff_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ func TestGetDiffPreview(t *testing.T) {
3535
Name: "README.md",
3636
OldName: "README.md",
3737
NameHash: "8ec9a00bfd09b3190ac6b22251dbb1aa95a0579d",
38-
Index: 1,
3938
Addition: 2,
4039
Deletion: 1,
4140
Type: 2,

0 commit comments

Comments
 (0)