@@ -62,18 +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 , "" )
70+
71+ spec = RefSpec ("refs/heads/love+hate:refs/heads/love+hate" )
72+ 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" )
6776}
6877
6978func (s * RefSpecSuite ) TestRefSpecMatch (c * C ) {
7079 spec := RefSpec ("refs/heads/master:refs/remotes/origin/master" )
7180 c .Assert (spec .Match (plumbing .ReferenceName ("refs/heads/foo" )), Equals , false )
7281 c .Assert (spec .Match (plumbing .ReferenceName ("refs/heads/master" )), Equals , true )
7382
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+
7487 spec = RefSpec (":refs/heads/master" )
7588 c .Assert (spec .Match (plumbing .ReferenceName ("" )), Equals , true )
7689 c .Assert (spec .Match (plumbing .ReferenceName ("refs/heads/master" )), Equals , false )
90+
91+ spec = RefSpec ("refs/heads/love+hate:heads/love+hate" )
92+ 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 )
7796}
7897
7998func (s * RefSpecSuite ) TestRefSpecMatchGlob (c * C ) {
0 commit comments