diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2015-11-10 21:07:29 +0100 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2015-11-10 21:07:29 +0100 |
commit | 49f40d9f410a6fc0a9c89ba228d16cd570ec711a (patch) | |
tree | 8d7e5cdab936131e7520f5462739857adf1eca8e /repository.go | |
parent | b7cf99f3e80e482e743448fb633612cd02090a7c (diff) | |
download | go-git-49f40d9f410a6fc0a9c89ba228d16cd570ec711a.tar.gz |
common: GitUploadPackRequest Want, Have methods
Diffstat (limited to 'repository.go')
-rw-r--r-- | repository.go | 14 |
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 } |