@@ -62,24 +62,37 @@ func (s *RefSpecSuite) TestRefSpecSrc(c *C) {
6262 spec := RefSpec ("refs/heads/*:refs/remotes/origin/*" )
6363 c .Assert (spec .Src (), Equals , "refs/heads/*" )
6464
65+ spec = RefSpec ("+refs/heads/*:refs/remotes/origin/*" )
66+ c .Assert (spec .Src (), Equals , "refs/heads/*" )
67+
6568 spec = RefSpec (":refs/heads/master" )
6669 c .Assert (spec .Src (), Equals , "" )
6770
6871 spec = RefSpec ("refs/heads/love+hate:refs/heads/love+hate" )
6972 c .Assert (spec .Src (), Equals , "refs/heads/love+hate" )
73+
74+ spec = RefSpec ("+refs/heads/love+hate:refs/heads/love+hate" )
75+ c .Assert (spec .Src (), Equals , "refs/heads/love+hate" )
7076}
7177
7278func (s * RefSpecSuite ) TestRefSpecMatch (c * C ) {
7379 spec := RefSpec ("refs/heads/master:refs/remotes/origin/master" )
7480 c .Assert (spec .Match (plumbing .ReferenceName ("refs/heads/foo" )), Equals , false )
7581 c .Assert (spec .Match (plumbing .ReferenceName ("refs/heads/master" )), Equals , true )
7682
83+ spec = RefSpec ("+refs/heads/master:refs/remotes/origin/master" )
84+ c .Assert (spec .Match (plumbing .ReferenceName ("refs/heads/foo" )), Equals , false )
85+ c .Assert (spec .Match (plumbing .ReferenceName ("refs/heads/master" )), Equals , true )
86+
7787 spec = RefSpec (":refs/heads/master" )
7888 c .Assert (spec .Match (plumbing .ReferenceName ("" )), Equals , true )
7989 c .Assert (spec .Match (plumbing .ReferenceName ("refs/heads/master" )), Equals , false )
8090
8191 spec = RefSpec ("refs/heads/love+hate:heads/love+hate" )
8292 c .Assert (spec .Match (plumbing .ReferenceName ("refs/heads/love+hate" )), Equals , true )
93+
94+ spec = RefSpec ("+refs/heads/love+hate:heads/love+hate" )
95+ c .Assert (spec .Match (plumbing .ReferenceName ("refs/heads/love+hate" )), Equals , true )
8396}
8497
8598func (s * RefSpecSuite ) TestRefSpecMatchGlob (c * C ) {
0 commit comments