From 6d19be9bdb355d2285138ead6cd487920b26fe99 Mon Sep 17 00:00:00 2001 From: Alberto Cortés Date: Mon, 11 Jan 2016 10:59:03 +0100 Subject: missing call to Close on Fetch return value (ReadCloser) --- repository.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'repository.go') diff --git a/repository.go b/repository.go index e63869a..5deddfb 100644 --- a/repository.go +++ b/repository.go @@ -53,7 +53,7 @@ func NewPlainRepository() *Repository { } } -func (r *Repository) Pull(remoteName, branch string) error { +func (r *Repository) Pull(remoteName, branch string) (err error) { remote, ok := r.Remotes[remoteName] if !ok { return fmt.Errorf("unable to find remote %q", remoteName) @@ -75,6 +75,9 @@ func (r *Repository) Pull(remoteName, branch string) error { if err != nil { return err } + defer func() { + err = reader.Close() + }() pr := packfile.NewReader(reader) if _, err = pr.Read(r.Storage); err != nil { -- cgit