MCPcopy Create free account
hub / github.com/go-git/go-git / TestFetchNonExistentReference

Method TestFetchNonExistentReference

remote_test.go:203–216  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

201}
202
203func (s *RemoteSuite) TestFetchNonExistentReference(c *C) {
204 r := NewRemote(memory.NewStorage(), &config.RemoteConfig{
205 URLs: []string{s.GetLocalRepositoryURL(fixtures.ByTag("tags").One())},
206 })
207
208 err := r.Fetch(&FetchOptions{
209 RefSpecs: []config.RefSpec{
210 config.RefSpec("+refs/heads/foo:refs/remotes/origin/foo"),
211 },
212 })
213
214 c.Assert(err, ErrorMatches, "couldn't find remote ref.*")
215 c.Assert(errors.Is(err, NoMatchingRefSpecError{}), Equals, true)
216}
217
218func (s *RemoteSuite) TestFetchContext(c *C) {
219 r := NewRemote(memory.NewStorage(), &config.RemoteConfig{

Callers

nothing calls this directly

Calls 6

FetchMethod · 0.95
NewStorageFunction · 0.92
RefSpecTypeAlias · 0.92
NewRemoteFunction · 0.85
GetLocalRepositoryURLMethod · 0.80
IsMethod · 0.80

Tested by

no test coverage detected