MCPcopy Index your code
hub / github.com/go-git/go-git / TestFetchNonExistentReference

Method TestFetchNonExistentReference

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

Source from the content-addressed store, hash-verified

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