fetch-negotiator: add specific noop initializer
Add a specific initializer for the noop fetch negotiator. This is introduced to support allowing partial clones to skip commit negotiation when performing a "refetch". Signed-off-by: Robert Coup <robert@coup.net.nz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Robert Coup committed
Mar 28, 2022 at 14:02 UTC
1836836593e90b515269b564b384dcf091a4493d
2 files changed
+13
fetch-negotiator.c
+5
@@ -23,3 +23,8 @@ void fetch_negotiator_init(struct repository *r,
23
return;
24
}
25
}
26
+
27
+void fetch_negotiator_init_noop(struct fetch_negotiator *negotiator)
28
+{
29
+ noop_negotiator_init(negotiator);
30
+}
fetch-negotiator.h
+8
@@ -53,7 +53,15 @@ struct fetch_negotiator {
53
void *data;
54
};
55
56
+/*
57
+ * Initialize a negotiator based on the repository settings.
58
+ */
59
void fetch_negotiator_init(struct repository *r,
60
struct fetch_negotiator *negotiator);
61
62
+/*
63
+ * Initialize a noop negotiator.
64
+ */
65
+void fetch_negotiator_init_noop(struct fetch_negotiator *negotiator);
66
+
67
#endif