blob: 65e3c200084aa4a198145e2433ad6055425ae2fa [file] [log] [blame]
Elijah Newrena64215b2023-02-24 00:09:30 +00001#include "git-compat-util.h"
Jonathan Tancbe566a2020-08-17 21:01:31 -07002#include "noop.h"
Jonathan Tancbe566a2020-08-17 21:01:31 -07003#include "../fetch-negotiator.h"
4
Jeff King06b217f2023-08-29 19:45:30 -04005static void known_common(struct fetch_negotiator *n UNUSED,
6 struct commit *c UNUSED)
Jonathan Tancbe566a2020-08-17 21:01:31 -07007{
8 /* do nothing */
9}
10
Jeff King06b217f2023-08-29 19:45:30 -040011static void add_tip(struct fetch_negotiator *n UNUSED,
12 struct commit *c UNUSED)
Jonathan Tancbe566a2020-08-17 21:01:31 -070013{
14 /* do nothing */
15}
16
Jeff King06b217f2023-08-29 19:45:30 -040017static const struct object_id *next(struct fetch_negotiator *n UNUSED)
Jonathan Tancbe566a2020-08-17 21:01:31 -070018{
19 return NULL;
20}
21
Jeff King06b217f2023-08-29 19:45:30 -040022static int ack(struct fetch_negotiator *n UNUSED, struct commit *c UNUSED)
Jonathan Tancbe566a2020-08-17 21:01:31 -070023{
24 /*
25 * This negotiator does not emit any commits, so there is no commit to
26 * be acknowledged. If there is any ack, there is a bug.
27 */
28 BUG("ack with noop negotiator, which does not emit any commits");
29 return 0;
30}
31
Jeff King06b217f2023-08-29 19:45:30 -040032static void release(struct fetch_negotiator *n UNUSED)
Jonathan Tancbe566a2020-08-17 21:01:31 -070033{
34 /* nothing to release */
35}
36
37void noop_negotiator_init(struct fetch_negotiator *negotiator)
38{
39 negotiator->known_common = known_common;
40 negotiator->add_tip = add_tip;
41 negotiator->next = next;
42 negotiator->ack = ack;
43 negotiator->release = release;
44 negotiator->data = NULL;
45}