@@ -9,6 +9,24 @@ pub enum Error {
9
9
NegotiationFailed { rounds : usize } ,
10
10
}
11
11
12
+ /// This function is modeled after the similarly named one in the git codebase and attempts to do the following:
13
+ ///
14
+ /// ### Performance Notes
15
+ ///
16
+ /// In `git`, the graph data structure is shared, whereas here we currently can't as the data we store is specific
17
+ /// to the respective user. Git makes sure that the flags used there don't overlap, and we would have to do the same
18
+ /// to get the same benefits. This explains why the negotiator code relies on commits being parsed already - it's a way
19
+ /// to observe that the caller already traversed there.
20
+ #[ allow( dead_code) ]
21
+ pub ( crate ) fn mark_complete_and_common_ref (
22
+ _negotiator : & mut dyn gix_negotiate:: Negotiator ,
23
+ _ref_map : & fetch:: RefMap ,
24
+ ) -> Result < ( ) , Error > {
25
+ // TODO: we probably want a priority list here, that's mostly how their linked list is used. Doing so might be faster,
26
+ // maybe their code is old enough not to use a prio list? Or maybe it's the opposite.
27
+ todo ! ( )
28
+ }
29
+
12
30
/// Negotiate one round with `algo` by looking at `ref_map` and adjust `arguments` to contain the haves and wants.
13
31
/// If this is not the first round, the `previous_response` is set with the last recorded server response.
14
32
/// Returns `true` if the negotiation is done from our side so the server won't keep asking.
@@ -34,9 +52,7 @@ pub(crate) fn one_round(
34
52
35
53
match algo {
36
54
Algorithm :: Noop | Algorithm :: Skipping | Algorithm :: Consecutive => {
37
- todo ! ( )
38
- }
39
- Algorithm :: Naive => {
55
+ // Use actual negotiation code here, this is the NAIVE implementation/hack
40
56
assert_eq ! ( round, 1 , "Naive always finishes after the first round, it claims." ) ;
41
57
let mut has_missing_tracking_branch = false ;
42
58
for mapping in & ref_map. mappings {
0 commit comments