aboutsummaryrefslogtreecommitdiffstats
path: root/repository.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-01-11 12:09:15 +0100
committerMáximo Cuadros <mcuadros@gmail.com>2016-01-11 12:09:15 +0100
commit37cc5cf842c3c0fb989bcf7525cc8f826d96b295 (patch)
treead234af3bd3af78992944858abc2095b3199df44 /repository.go
parentcebec78608e7913b8c843390237fd609069022ae (diff)
parent6d19be9bdb355d2285138ead6cd487920b26fe99 (diff)
downloadgo-git-37cc5cf842c3c0fb989bcf7525cc8f826d96b295.tar.gz
Merge pull request #12 from alcortesm/hotfix-close-packfilev2.1.2
missing call to Close on Fetch return value (ReadCloser)
Diffstat (limited to 'repository.go')
-rw-r--r--repository.go5
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 {