aboutsummaryrefslogtreecommitdiffstats
path: root/repository.go
diff options
context:
space:
mode:
Diffstat (limited to 'repository.go')
-rw-r--r--repository.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/repository.go b/repository.go
index bf45fdc..32a6fcf 100644
--- a/repository.go
+++ b/repository.go
@@ -66,17 +66,19 @@ func (r *Repository) Pull(remoteName, branch string) error {
return err
}
- reader, err := remote.Fetch(&common.GitUploadPackRequest{
- Want: []core.Hash{ref},
- })
-
- pr := packfile.NewReader(reader)
- _, err = pr.Read(r.Storage)
+ req := &common.GitUploadPackRequest{}
+ req.Want(ref)
+ reader, err := remote.Fetch(req)
if err != nil {
return err
}
+ pr := packfile.NewReader(reader)
+ if _, err = pr.Read(r.Storage); err != nil {
+ return err
+ }
+
return nil
}