diff options
-rw-r--r-- | options.go | 2 | ||||
-rw-r--r-- | remote_test.go | 16 |
2 files changed, 18 insertions, 0 deletions
@@ -113,6 +113,8 @@ var ( // AllTags fetch all tags from the remote (i.e., fetch remote tags // refs/tags/* into local tags with the same name) AllTags TagFetchMode = 1 + //NoTags fetch no tags from the remote at all + NoTags TagFetchMode = 2 ) // FetchOptions describes how a fetch should be performed diff --git a/remote_test.go b/remote_test.go index 7ffe040..e8ddb21 100644 --- a/remote_test.go +++ b/remote_test.go @@ -120,6 +120,22 @@ func (s *RemoteSuite) TestFetchWithAllTags(c *C) { }) } +func (s *RemoteSuite) TestFetchWithNoTags(c *C) { + r := newRemote(memory.NewStorage(), &config.RemoteConfig{ + URL: s.GetLocalRepositoryURL(fixtures.ByTag("tags").One()), + }) + + s.testFetch(c, r, &FetchOptions{ + Tags: NoTags, + RefSpecs: []config.RefSpec{ + config.RefSpec("+refs/heads/master:refs/remotes/origin/master"), + }, + }, []*plumbing.Reference{ + plumbing.NewReferenceFromStrings("refs/remotes/origin/master", "f7b877701fbf855b44c0a9e86f3fdce2c298b07f"), + }) + +} + func (s *RemoteSuite) TestFetchWithDepth(c *C) { r := newRemote(memory.NewStorage(), &config.RemoteConfig{ URL: s.GetBasicLocalRepositoryURL(), |