From 2cd2d64b162cd2343b99767d796888997abc702a Mon Sep 17 00:00:00 2001 From: Nick Thomas Date: Sat, 22 Jul 2017 09:02:17 +0100 Subject: Implement a NoTags mode for fetch that mimics git fetch --no-tags --- remote_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'remote_test.go') 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(), -- cgit