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