diff --git a/lfs/diff_index_scanner.go b/lfs/diff_index_scanner.go index d5e54fd9..717cdecf 100644 --- a/lfs/diff_index_scanner.go +++ b/lfs/diff_index_scanner.go @@ -99,19 +99,19 @@ type DiffIndexScanner struct { // If any error was encountered in starting the command or closing its `stdin`, // that error will be returned immediately. Otherwise, a `*DiffIndexScanner` // will be returned with a `nil` error. -func NewDiffIndexScanner(ref string, cached bool) (*DiffIndexScanner, *wrappedCmd, error) { +func NewDiffIndexScanner(ref string, cached bool) (*DiffIndexScanner, error) { cmd, err := startCommand("git", diffIndexCmdArgs(ref, cached)...) if err != nil { - return nil, cmd, errors.Wrap(err, "diff-index") + return nil, errors.Wrap(err, "diff-index") } if err = cmd.Stdin.Close(); err != nil { - return nil, cmd, errors.Wrap(err, "diff-index: close") + return nil, errors.Wrap(err, "diff-index: close") } return &DiffIndexScanner{ from: bufio.NewScanner(cmd.Stdout), - }, cmd, nil + }, nil } // diffIndexCmdArgs returns a string slice containing the arguments necessary diff --git a/lfs/gitscanner_index.go b/lfs/gitscanner_index.go index f968eeea..8c98411e 100644 --- a/lfs/gitscanner_index.go +++ b/lfs/gitscanner_index.go @@ -105,7 +105,7 @@ func scanIndex(cb GitScannerFoundPointer, ref string) error { // for in the indexf. It returns a channel from which sha1 strings can be read. // The namMap will be filled indexFile pointers mapping sha1s to indexFiles. func revListIndex(atRef string, cache bool, indexMap *indexFileMap) (*StringChannelWrapper, error) { - scanner, cmd, err := NewDiffIndexScanner(atRef, cache) + scanner, err := NewDiffIndexScanner(atRef, cache) if err != nil { return nil, err } @@ -138,8 +138,6 @@ func revListIndex(atRef string, cache bool, indexMap *indexFileMap) (*StringChan errs <- err } - cmd.Wait() - close(revs) close(errs) }()