Skip to content

Commit 4be4f67

Browse files
committed
object_db: use ReadCloser for uncompressed objects
When we open a new object using the object database, ensure that we use a ReadCloser for the uncompressed object. This ensures that we close the file we've opened when reading loose objects so we don't run out of file descriptors. Note that we do use this code path for reading loose objects in some cases because we hand it a ReadCloser which automatically decompresses the object.
1 parent 1e97572 commit 4be4f67

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

object_db.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ func (o *ObjectDatabase) open(sha []byte) (*ObjectReader, error) {
285285
if o.ro.IsCompressed() {
286286
return NewObjectReadCloser(f)
287287
}
288-
return NewUncompressedObjectReader(f)
288+
return NewUncompressedObjectReadCloser(f)
289289
}
290290

291291
// openDecode calls decode (see: below) on the object named "sha" after openin

0 commit comments

Comments
 (0)