MCPcopy
hub / github.com/go-git/go-git / TestFetchToNewBranch

Method TestFetchToNewBranch

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

Source from the content-addressed store, hash-verified

148}
149
150func (s *RemoteSuite) TestFetchToNewBranch(c *C) {
151 r := NewRemote(memory.NewStorage(), &config.RemoteConfig{
152 URLs: []string{s.GetLocalRepositoryURL(fixtures.ByTag("tags").One())},
153 })
154
155 s.testFetch(c, r, &FetchOptions{
156 RefSpecs: []config.RefSpec{
157 // qualified branch to unqualified branch
158 "refs/heads/master:foo",
159 // unqualified branch to unqualified branch
160 "+master:bar",
161 // unqualified tag to unqualified branch
162 config.RefSpec("tree-tag:tree-tag"),
163 // unqualified tag to qualified tag
164 config.RefSpec("+commit-tag:refs/tags/renamed-tag"),
165 },
166 }, []*plumbing.Reference{
167 plumbing.NewReferenceFromStrings("refs/heads/foo", "f7b877701fbf855b44c0a9e86f3fdce2c298b07f"),
168 plumbing.NewReferenceFromStrings("refs/heads/bar", "f7b877701fbf855b44c0a9e86f3fdce2c298b07f"),
169 plumbing.NewReferenceFromStrings("refs/heads/tree-tag", "152175bf7e5580299fa1f0ba41ef6474cc043b70"),
170 plumbing.NewReferenceFromStrings("refs/tags/tree-tag", "152175bf7e5580299fa1f0ba41ef6474cc043b70"),
171 plumbing.NewReferenceFromStrings("refs/tags/renamed-tag", "ad7897c0fb8e7d9a9ba41fa66072cf06095a6cfc"),
172 plumbing.NewReferenceFromStrings("refs/tags/commit-tag", "ad7897c0fb8e7d9a9ba41fa66072cf06095a6cfc"),
173 })
174}
175
176func (s *RemoteSuite) TestFetchToNewBranchWithAllTags(c *C) {
177 r := NewRemote(memory.NewStorage(), &config.RemoteConfig{

Callers

nothing calls this directly

Calls 6

testFetchMethod · 0.95
NewStorageFunction · 0.92
RefSpecTypeAlias · 0.92
NewReferenceFromStringsFunction · 0.92
NewRemoteFunction · 0.85
GetLocalRepositoryURLMethod · 0.80

Tested by

no test coverage detected