diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2018-06-21 12:40:21 +0200 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2018-06-21 12:40:21 +0200 |
commit | b53ba8dcffd24e25815feff78e8246597e949f21 (patch) | |
tree | 377ed463706d8e88732e9bd877af97afbf0f05b0 /remote_test.go | |
parent | 0710c6cb710a0cdab04ab7f61cc62e23cfcacbee (diff) | |
download | go-git-b53ba8dcffd24e25815feff78e8246597e949f21.tar.gz |
Remote.Fetch: error on missing remote reference
Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
Diffstat (limited to 'remote_test.go')
-rw-r--r-- | remote_test.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/remote_test.go b/remote_test.go index 82ec1fc..dd386b0 100644 --- a/remote_test.go +++ b/remote_test.go @@ -100,6 +100,20 @@ func (s *RemoteSuite) TestFetch(c *C) { }) } +func (s *RemoteSuite) TestFetchNonExistantReference(c *C) { + r := newRemote(memory.NewStorage(), &config.RemoteConfig{ + URLs: []string{s.GetLocalRepositoryURL(fixtures.ByTag("tags").One())}, + }) + + err := r.Fetch(&FetchOptions{ + RefSpecs: []config.RefSpec{ + config.RefSpec("+refs/heads/foo:refs/remotes/origin/foo"), + }, + }) + + c.Assert(err, ErrorMatches, "couldn't find remote ref.*") +} + func (s *RemoteSuite) TestFetchContext(c *C) { r := newRemote(memory.NewStorage(), &config.RemoteConfig{ URLs: []string{s.GetLocalRepositoryURL(fixtures.ByTag("tags").One())}, |