lfs: don't close pointer scanner on error

On error, we used to attempt to close the pointer scanner to free the
resources that were associated with git cat-file --batch.  However, now
that we're using a gitobj-based scanner, there are no resources of that
kind to free.  Moreover, we only return an error if we return nil for
the scanner object, so attempting to close the scanner leads to a nil
pointer dereference.

Remove the calls to close the scanner when an error occurs.

Signed-off-by: brian m. carlson <bk2204@github.com>
This commit is contained in:
brian m. carlson 2018-11-16 14:34:33 +00:00
parent c825e5ae65
commit 7dae495442
No known key found for this signature in database
GPG Key ID: 2D0C9BC12F82B3A1
2 changed files with 0 additions and 4 deletions

@ -34,8 +34,6 @@ func statusCommand(cmd *cobra.Command, args []string) {
scanner, err := lfs.NewPointerScanner() scanner, err := lfs.NewPointerScanner()
if err != nil { if err != nil {
scanner.Close()
ExitWithError(err) ExitWithError(err)
} }

@ -49,8 +49,6 @@ func runScanTree(cb GitScannerFoundPointer, ref string, filter *filepathfilter.F
func catFileBatchTree(treeblobs *TreeBlobChannelWrapper) (*PointerChannelWrapper, error) { func catFileBatchTree(treeblobs *TreeBlobChannelWrapper) (*PointerChannelWrapper, error) {
scanner, err := NewPointerScanner() scanner, err := NewPointerScanner()
if err != nil { if err != nil {
scanner.Close()
return nil, err return nil, err
} }