aboutsummaryrefslogtreecommitdiffstats
path: root/remote_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2018-06-26 14:04:45 +0200
committerGitHub <noreply@github.com>2018-06-26 14:04:45 +0200
commit662e2c226e9b8352a90cd1951233fab30a4e5042 (patch)
tree27c4aaadba52b8c6f4ff8176ac98952a3bcb007b /remote_test.go
parentb11eaabdfd82deb68537fd44176d58084a6f367d (diff)
parentb53ba8dcffd24e25815feff78e8246597e949f21 (diff)
downloadgo-git-662e2c226e9b8352a90cd1951233fab30a4e5042.tar.gz
Merge pull request #870 from mcuadros/fetch-error
Remote.Fetch: error on missing remote reference
Diffstat (limited to 'remote_test.go')
-rw-r--r--remote_test.go14
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())},