diff options
author | zeripath <art27@cantab.net> | 2021-06-02 10:03:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-02 11:03:28 +0200 |
commit | da810275bf682d29a530ed819aff175f47bd7634 (patch) | |
tree | 615e4c2b301532a211e739143b28df313b110dfb /utils/ioutil | |
parent | db4233e9e8b3b2e37259ed4e7952faaed16218b9 (diff) | |
download | go-git-da810275bf682d29a530ed819aff175f47bd7634.tar.gz |
Revert "plumbing: format/packfile, prevent large objects from being read into memory completely (#303)" (#329)v5.4.2
This reverts commit 720c192831a890d0a36b4c6720b60411fa4a0159.
Diffstat (limited to 'utils/ioutil')
-rw-r--r-- | utils/ioutil/common.go | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/utils/ioutil/common.go b/utils/ioutil/common.go index a0e79a2..b52e85a 100644 --- a/utils/ioutil/common.go +++ b/utils/ioutil/common.go @@ -55,28 +55,6 @@ func NewReadCloser(r io.Reader, c io.Closer) io.ReadCloser { return &readCloser{Reader: r, closer: c} } -type readCloserCloser struct { - io.ReadCloser - closer func() error -} - -func (r *readCloserCloser) Close() (err error) { - defer func() { - if err == nil { - err = r.closer() - return - } - _ = r.closer() - }() - return r.ReadCloser.Close() -} - -// NewReadCloserWithCloser creates an `io.ReadCloser` with the given `io.ReaderCloser` and -// `io.Closer` that ensures that the closer is closed on close -func NewReadCloserWithCloser(r io.ReadCloser, c func() error) io.ReadCloser { - return &readCloserCloser{ReadCloser: r, closer: c} -} - type writeCloser struct { io.Writer closer io.Closer |