@@ -18,7 +18,7 @@ def _print_fetchhead(self, repo):
1818
1919
2020 def _test_fetch_result (self , results , remote ):
21- # self._print_fetchhead(remote.repo)
21+ self ._print_fetchhead (remote .repo )
2222 assert len (results ) > 0 and isinstance (results [0 ], remote .FetchInfo )
2323 for info in results :
2424 assert info .flags != 0
@@ -38,8 +38,8 @@ def _test_fetch(self,remote, rw_repo, remote_repo):
3838 # specialized fetch testing to de-clutter the main test
3939 self ._test_fetch_info (rw_repo )
4040
41- def fetch_and_test (remote ):
42- res = remote .fetch ()
41+ def fetch_and_test (remote , ** kwargs ):
42+ res = remote .fetch (** kwargs )
4343 self ._test_fetch_result (res , remote )
4444 return res
4545 # END fetch and check
@@ -93,6 +93,23 @@ def get_info(res, remote, name):
9393 assert len (stale_refs ) == 2 and isinstance (stale_refs [0 ], RemoteReference )
9494 RemoteReference .delete (rw_repo , * stale_refs )
9595
96+ # test single branch fetch with refspec
97+ res = fetch_and_test (remote , refspec = "master:refs/remotes/%s/master" % remote )
98+ assert len (res ) == 1 and get_info (res , remote , 'master' )
99+
100+ # without refspec
101+ res = fetch_and_test (remote , refspec = 'master' )
102+ assert len (res ) == 1
103+
104+ # add new tag reference
105+ rtag = TagReference .create (remote_repo , "1.0-RV_hello.there" )
106+ res = fetch_and_test (remote , tags = True )
107+ ltag = res [str (rtag )]
108+ assert isinstance (ltag , TagReference )
109+
110+ # delete tag
111+
112+ # adjust tag commit
96113
97114 self .fail ("tag handling, tag uptodate, new tag, new branch" )
98115
0 commit comments