@@ -152,7 +152,7 @@ mod tests {
152
152
use super :: * ;
153
153
use crate :: sync:: {
154
154
self ,
155
- remotes:: { fetch, push:: push} ,
155
+ remotes:: { fetch, fetch_all , push:: push} ,
156
156
tests:: { repo_clone, repo_init_bare} ,
157
157
} ;
158
158
use pretty_assertions:: assert_eq;
@@ -276,7 +276,7 @@ mod tests {
276
276
}
277
277
278
278
#[ test]
279
- fn test_tags_fetch_same_branch ( ) {
279
+ fn test_tags_fetch ( ) {
280
280
let ( r1_dir, _repo) = repo_init_bare ( ) . unwrap ( ) ;
281
281
let r1_dir = r1_dir. path ( ) . to_str ( ) . unwrap ( ) ;
282
282
@@ -312,4 +312,42 @@ mod tests {
312
312
313
313
assert_eq ! ( tags1, tags2) ;
314
314
}
315
+
316
+ #[ test]
317
+ fn test_tags_fetch_all ( ) {
318
+ let ( r1_dir, _repo) = repo_init_bare ( ) . unwrap ( ) ;
319
+ let r1_dir = r1_dir. path ( ) . to_str ( ) . unwrap ( ) ;
320
+
321
+ let ( clone1_dir, clone1) = repo_clone ( r1_dir) . unwrap ( ) ;
322
+ let clone1_dir = clone1_dir. path ( ) . to_str ( ) . unwrap ( ) ;
323
+
324
+ let commit1 =
325
+ write_commit_file ( & clone1, "test.txt" , "test" , "commit1" ) ;
326
+ push (
327
+ clone1_dir, "origin" , "master" , false , false , None , None ,
328
+ )
329
+ . unwrap ( ) ;
330
+
331
+ let ( clone2_dir, _clone2) = repo_clone ( r1_dir) . unwrap ( ) ;
332
+ let clone2_dir = clone2_dir. path ( ) . to_str ( ) . unwrap ( ) ;
333
+
334
+ // clone1 - creates tag
335
+
336
+ sync:: tag ( clone1_dir, & commit1, "tag1" ) . unwrap ( ) ;
337
+
338
+ let tags1 = sync:: get_tags ( clone1_dir) . unwrap ( ) ;
339
+
340
+ push_tags ( clone1_dir, "origin" , None , None ) . unwrap ( ) ;
341
+ let tags_missing =
342
+ tags_missing_remote ( clone1_dir, "origin" , None ) . unwrap ( ) ;
343
+ assert ! ( tags_missing. is_empty( ) ) ;
344
+
345
+ // clone 2 - pull
346
+
347
+ fetch_all ( clone2_dir, & None , & None ) . unwrap ( ) ;
348
+
349
+ let tags2 = sync:: get_tags ( clone2_dir) . unwrap ( ) ;
350
+
351
+ assert_eq ! ( tags1, tags2) ;
352
+ }
315
353
}
0 commit comments