diff options
author | Alberto Cortés <alberto@sourced.tech> | 2016-01-11 10:59:03 +0100 |
---|---|---|
committer | Alberto Cortés <alberto@sourced.tech> | 2016-01-11 11:43:51 +0100 |
commit | 6d19be9bdb355d2285138ead6cd487920b26fe99 (patch) | |
tree | ad234af3bd3af78992944858abc2095b3199df44 /repository.go | |
parent | cebec78608e7913b8c843390237fd609069022ae (diff) | |
download | go-git-6d19be9bdb355d2285138ead6cd487920b26fe99.tar.gz |
missing call to Close on Fetch return value (ReadCloser)
Diffstat (limited to 'repository.go')
-rw-r--r-- | repository.go | 5 |
1 files changed, 4 insertions, 1 deletions
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 { |