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:
parent
c825e5ae65
commit
7dae495442
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user