@@ -16,7 +16,9 @@ public class FetchFixture : BaseFixture
16
16
[ InlineData ( "git://github.com/libgit2/TestGitRepository.git" ) ]
17
17
public void CanFetchIntoAnEmptyRepository ( string url )
18
18
{
19
- using ( var repo = InitIsolatedRepository ( ) )
19
+ string path = InitNewRepository ( ) ;
20
+
21
+ using ( var repo = new Repository ( path ) )
20
22
{
21
23
Remote remote = repo . Network . Remotes . Add ( remoteName , url ) ;
22
24
@@ -53,7 +55,9 @@ public void CanFetchIntoAnEmptyRepositoryWithCredentials()
53
55
InconclusiveIf ( ( ) => string . IsNullOrEmpty ( Constants . PrivateRepoUrl ) ,
54
56
"Populate Constants.PrivateRepo* to run this test" ) ;
55
57
56
- using ( var repo = InitIsolatedRepository ( ) )
58
+ string path = InitNewRepository ( ) ;
59
+
60
+ using ( var repo = new Repository ( path ) )
57
61
{
58
62
Remote remote = repo . Network . Remotes . Add ( remoteName , Constants . PrivateRepoUrl ) ;
59
63
@@ -71,7 +75,9 @@ public void CanFetchIntoAnEmptyRepositoryWithCredentials()
71
75
[ InlineData ( "git://github.com/libgit2/TestGitRepository.git" ) ]
72
76
public void CanFetchAllTagsIntoAnEmptyRepository ( string url )
73
77
{
74
- using ( var repo = InitIsolatedRepository ( ) )
78
+ string path = InitNewRepository ( ) ;
79
+
80
+ using ( var repo = new Repository ( path ) )
75
81
{
76
82
Remote remote = repo . Network . Remotes . Add ( remoteName , url ) ;
77
83
@@ -112,7 +118,9 @@ public void CanFetchAllTagsIntoAnEmptyRepository(string url)
112
118
[ InlineData ( "git://github.com/libgit2/TestGitRepository.git" , "master" , "first-merge" ) ]
113
119
public void CanFetchCustomRefSpecsIntoAnEmptyRepository (
10000
string url , string localBranchName , string remoteBranchName )
114
120
{
115
- using ( var repo = InitIsolatedRepository ( ) )
121
+ string path = InitNewRepository ( ) ;
122
+
123
+ using ( var repo = new Repository ( path ) )
116
124
{
117
125
Remote remote = repo . Network . Remotes . Add ( remoteName , url ) ;
118
126
@@ -139,15 +147,17 @@ public void CanFetchCustomRefSpecsIntoAnEmptyRepository(string url, string local
139
147
}
140
148
}
141
149
142
- [ Theory ( Skip = "Skipping due to recent github handling modification of --include-tag." ) ]
150
+ [ Theory ]
143
151
[ InlineData ( TagFetchMode . All , 4 ) ]
144
152
[ InlineData ( TagFetchMode . None , 0 ) ]
145
- [ InlineData ( TagFetchMode . Auto , 3 ) ]
153
+ // [InlineData(TagFetchMode.Auto, 3)] // TODO: Skipping due to github modification of --include-tag handling."
146
154
public void FetchRespectsConfiguredAutoTagSetting ( TagFetchMode tagFetchMode , int expectedTagCount )
147
155
{
148
156
string url = "http://github.com/libgit2/TestGitRepository" ;
149
157
150
- using ( var repo = InitIsolatedRepository ( ) )
158
+ string path = InitNewRepository ( ) ;
159
+
160
+ using ( var repo = new Repository ( path ) )
151
161
{
152
162
Remote remote = repo . Network . Remotes . Add ( remoteName , url ) ;
153
163
Assert . NotNull ( remote ) ;
@@ -163,5 +173,20 @@ public void FetchRespectsConfiguredAutoTagSetting(TagFetchMode tagFetchMode, int
163
173
Assert . Equal ( expectedTagCount , repo . Tags . Count ( ) ) ;
164
174
}
165
175
}
176
+
177
+ [ Fact ]
178
+ public void CanFetchAllTagsAfterAnInitialClone ( )
179
+ {
180
+ var scd = BuildSelfCleaningDirectory ( ) ;
181
+
182
+ const string url = "https://github.com/libgit2/TestGitRepository" ;
183
+
184
+ string clonedRepoPath = Repository . Clone ( url , scd . DirectoryPath ) ;
185
+
186
+ using ( var repo = new Repository ( clonedRepoPath ) )
187
+ {
188
+ repo . Fetch ( "origin" , new FetchOptions { TagFetchMode = TagFetchMode . All } ) ;
189
+ }
190
+ }
166
191
}
167
192
}
0 commit comments