@@ -118,6 +118,58 @@ dce0ea858eef7ff61ad345cc5cdac62203fb3c10 refs/tags/gix-commitgraph-v0.0.0
118
118
) ;
119
119
}
120
120
121
+ #[ maybe_async:: test( feature = "blocking-client" , async ( feature = "async-client" , async_std:: test) ) ]
122
+ async fn extract_references_from_v1_refs_with_shallow ( ) {
123
+ let input = & mut Fixture (
124
+ "73a6868963993a3328e7d8fe94e5a6ac5078a944 HEAD
125
+ 21c9b7500cb144b3169a6537961ec2b9e865be81 MISSING_NAMESPACE_TARGET
126
+ 73a6868963993a3328e7d8fe94e5a6ac5078a944 refs/heads/main
127
+ 8e472f9ccc7d745927426cbb2d9d077de545aa4e refs/pull/13/head
128
+ dce0ea858eef7ff61ad345cc5cdac62203fb3c10 refs/tags/gix-commitgraph-v0.0.0
129
+ 21c9b7500cb144b3169a6537961ec2b9e865be81 refs/tags/gix-commitgraph-v0.0.0^{}
130
+ shallow 21c9b7500cb144b3169a6537961ec2b9e865be81
131
+ shallow dce0ea858eef7ff61ad345cc5cdac62203fb3c10"
132
+ . as_bytes ( ) ,
133
+ ) ;
134
+ let out = refs:: from_v1_refs_received_as_part_of_handshake_and_capabilities (
135
+ input,
136
+ Capabilities :: from_bytes ( b"\0 symref=HEAD:refs/heads/main symref=MISSING_NAMESPACE_TARGET:(null)" )
137
+ . expect ( "valid capabilities" )
138
+ . 0
139
+ . iter ( ) ,
140
+ )
141
+ . await
142
+ . expect ( "no failure from valid input" ) ;
143
+ assert_eq ! (
144
+ out,
145
+ vec![
146
+ Ref :: Symbolic {
147
+ full_ref_name: "HEAD" . into( ) ,
148
+ target: "refs/heads/main" . into( ) ,
149
+ tag: None ,
150
+ object: oid( "73a6868963993a3328e7d8fe94e5a6ac5078a944" )
151
+ } ,
152
+ Ref :: Direct {
153
+ full_ref_name: "MISSING_NAMESPACE_TARGET" . into( ) ,
154
+ object: oid( "21c9b7500cb144b3169a6537961ec2b9e865be81" )
155
+ } ,
156
+ Ref :: Direct {
157
+ full_ref_name: "refs/heads/main" . into( ) ,
158
+ object: oid( "73a6868963993a3328e7d8fe94e5a6ac5078a944" )
159
+ } ,
160
+ Ref :: Direct {
161
+ full_ref_name: "refs/pull/13/head" . into( ) ,
162
+ object: oid( "8e472f9ccc7d745927426cbb2d9d077de545aa4e" )
163
+ } ,
164
+ Ref :: Peeled {
165
+ full_ref_name: "refs/tags/gix-commitgraph-v0.0.0" . into( ) ,
166
+ tag: oid( "dce0ea858eef7ff61ad345cc5cdac62203fb3c10" ) ,
167
+ object: oid( "21c9b7500cb144b3169a6537961ec2b9e865be81" )
168
+ } ,
169
+ ]
170
+ ) ;
171
+ }
172
+
121
173
#[ test]
122
174
fn extract_symbolic_references_from_capabilities ( ) -> Result < ( ) , client:: Error > {
123
175
let caps = client:: Capabilities :: from_bytes (
0 commit comments