This repository was archived by the owner on Sep 11, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,8 @@ var (
113
113
// AllTags fetch all tags from the remote (i.e., fetch remote tags
114
114
// refs/tags/* into local tags with the same name)
115
115
AllTags TagFetchMode = 1
116
+ //NoTags fetch no tags from the remote at all
117
+ NoTags TagFetchMode = 2
116
118
)
117
119
118
120
// FetchOptions describes how a fetch should be performed
Original file line number Diff line number Diff line change @@ -120,6 +120,22 @@ func (s *RemoteSuite) TestFetchWithAllTags(c *C) {
120
120
})
121
121
}
122
122
123
+ func (s * RemoteSuite ) TestFetchWithNoTags (c * C ) {
124
+ r := newRemote (memory .NewStorage (), & config.RemoteConfig {
125
+ URL : s .GetLocalRepositoryURL (fixtures .ByTag ("tags" ).One ()),
126
+ })
127
+
128
+ s .testFetch (c , r , & FetchOptions {
129
+ Tags : NoTags ,
130
+ RefSpecs : []config.RefSpec {
131
+ config .RefSpec ("+refs/heads/master:refs/remotes/origin/master" ),
132
+ },
133
+ }, []* plumbing.Reference {
134
+ plumbing .NewReferenceFromStrings ("refs/remotes/origin/master" , "f7b877701fbf855b44c0a9e86f3fdce2c298b07f" ),
135
+ })
136
+
137
+ }
138
+
123
139
func (s * RemoteSuite ) TestFetchWithDepth (c * C ) {
124
140
r := newRemote (memory .NewStorage (), & config.RemoteConfig {
125
141
URL : s .GetBasicLocalRepositoryURL (),
You can’t perform that action at this time.
0 commit comments