@@ -62,18 +62,37 @@ func (s *RefSpecSuite) TestRefSpecSrc(c *C) {
62
62
spec := RefSpec ("refs/heads/*:refs/remotes/origin/*" )
63
63
c .Assert (spec .Src (), Equals , "refs/heads/*" )
64
64
65
+ spec = RefSpec ("+refs/heads/*:refs/remotes/origin/*" )
66
+ c .Assert (spec .Src (), Equals , "refs/heads/*" )
67
+
65
68
spec = RefSpec (":refs/heads/master" )
66
69
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" )
67
76
}
68
77
69
78
func (s * RefSpecSuite ) TestRefSpecMatch (c * C ) {
70
79
spec := RefSpec ("refs/heads/master:refs/remotes/origin/master" )
71
80
c .Assert (spec .Match (plumbing .ReferenceName ("refs/heads/foo" )), Equals , false )
72
81
c .Assert (spec .Match (plumbing .ReferenceName ("refs/heads/master" )), Equals , true )
73
82
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
+
74
87
spec = RefSpec (":refs/heads/master" )
75
88
c .Assert (spec .Match (plumbing .ReferenceName ("" )), Equals , true )
76
89
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 )
77
96
}
78
97
79
98
func (s * RefSpecSuite ) TestRefSpecMatchGlob (c * C ) {
0 commit comments