Skip to content

Commit c8c1b33

Browse files
Chi-IrohThomas Sayen
authored andcommitted
Fix last commit discarded
1 parent 32c1128 commit c8c1b33

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

modules/git/repo_commit.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ package git
66

77
import (
88
"bytes"
9-
"fmt"
109
"io"
1110
"os"
1211
"strconv"
@@ -251,14 +250,11 @@ func (repo *Repository) CommitsByFileAndRange(opts CommitsByFileAndRangeOptions)
251250
}
252251

253252
gitCmd.AddDashesAndList(opts.File)
254-
fmt.Print(gitCmd)
255-
fmt.Fprint(os.Stdout, "")
256253
err := gitCmd.Run(repo.Ctx, &RunOpts{
257254
Dir: repo.Path,
258255
Stdout: stdoutWriter,
259256
Stderr: &stderr,
260257
})
261-
fmt.Print("1 ", err)
262258
if err != nil && err != io.ErrUnexpectedEOF {
263259
_ = stdoutWriter.CloseWithError(ConcatenateError(err, (&stderr).String()))
264260
} else {
@@ -267,7 +263,6 @@ func (repo *Repository) CommitsByFileAndRange(opts CommitsByFileAndRangeOptions)
267263
}()
268264

269265
objectFormat, err := repo.GetObjectFormat()
270-
fmt.Print("object", err)
271266
if err != nil {
272267
return nil, err
273268
}
@@ -277,9 +272,8 @@ func (repo *Repository) CommitsByFileAndRange(opts CommitsByFileAndRangeOptions)
277272
shaline := make([]byte, length+1)
278273
for {
279274
n, err := io.ReadFull(stdoutReader, shaline)
280-
fmt.Print("io", err)
281-
if err != nil || n < length {
282-
if err == io.EOF || err == io.ErrUnexpectedEOF {
275+
if (err != nil && err != io.ErrUnexpectedEOF) || n < length {
276+
if err == io.EOF {
283277
err = nil
284278
}
285279
return commits, err

0 commit comments

Comments
 (0)