From b53ba8dcffd24e25815feff78e8246597e949f21 Mon Sep 17 00:00:00 2001 From: Máximo Cuadros Date: Thu, 21 Jun 2018 12:40:21 +0200 Subject: Remote.Fetch: error on missing remote reference MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Máximo Cuadros --- remote_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'remote_test.go') 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())}, -- cgit