Skip to content

Commit aaec98d

Browse files
committed
Improvements
1 parent 861c6c6 commit aaec98d

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

modules/git/batch_reader.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ func ReadBatchLine(rd *bufio.Reader) (sha []byte, typ string, size int64, err er
6868
typ = typ[:idx]
6969

7070
size, err = strconv.ParseInt(sizeStr, 10, 64)
71-
7271
return sha, typ, size, err
7372
}
7473

modules/git/commit_info_nogogit.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ func GetLastCommitForPaths(ctx context.Context, commit *Commit, treePath string,
130130
}
131131
defer cancel()
132132

133-
rd := batch.Reader()
133+
batchReader := batch.Reader()
134134

135135
commitsMap := map[string]*Commit{}
136136
commitsMap[commit.ID.String()] = commit
@@ -150,21 +150,21 @@ func GetLastCommitForPaths(ctx context.Context, commit *Commit, treePath string,
150150
if err := batch.Input(commitID); err != nil {
151151
return nil, err
152152
}
153-
_, typ, size, err := ReadBatchLine(rd)
153+
_, typ, size, err := ReadBatchLine(batchReader)
154154
if err != nil {
155155
return nil, err
156156
}
157157
if typ != "commit" {
158-
if err := DiscardFull(rd, size+1); err != nil {
158+
if err := DiscardFull(batchReader, size+1); err != nil {
159159
return nil, err
160160
}
161161
return nil, fmt.Errorf("unexpected type: %s for commit id: %s", typ, commitID)
162162
}
163-
c, err = CommitFromReader(commit.repo, MustIDFromString(commitID), io.LimitReader(rd, size))
163+
c, err = CommitFromReader(commit.repo, MustIDFromString(commitID), io.LimitReader(batchReader, size))
164164
if err != nil {
165165
return nil, err
166166
}
167-
if _, err := rd.Discard(1); err != nil {
167+
if _, err := batchReader.Discard(1); err != nil {
168168
return nil, err
169169
}
170170
commitCommits[path] = c

modules/git/pipeline/lfs_nogogit.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ func FindLFSFile(repo *git.Repository, objectID git.ObjectID) ([]*LFSResult, err
137137
if err := batch.Input(string(trees[len(trees)-1])); err != nil {
138138
return nil, err
139139
}
140-
141140
curPath = paths[len(paths)-1]
142141
trees = trees[:len(trees)-1]
143142
paths = paths[:len(paths)-1]

0 commit comments

Comments
 (0)