]> git.ipfire.org Git - thirdparty/git.git/blob - negotiator/noop.c
Merge branch 'js/ci-use-macos-13'
[thirdparty/git.git] / negotiator / noop.c
1 #include "git-compat-util.h"
2 #include "noop.h"
3 #include "../commit.h"
4 #include "../fetch-negotiator.h"
5
6 static void known_common(struct fetch_negotiator *n UNUSED,
7 struct commit *c UNUSED)
8 {
9 /* do nothing */
10 }
11
12 static void add_tip(struct fetch_negotiator *n UNUSED,
13 struct commit *c UNUSED)
14 {
15 /* do nothing */
16 }
17
18 static const struct object_id *next(struct fetch_negotiator *n UNUSED)
19 {
20 return NULL;
21 }
22
23 static int ack(struct fetch_negotiator *n UNUSED, struct commit *c UNUSED)
24 {
25 /*
26 * This negotiator does not emit any commits, so there is no commit to
27 * be acknowledged. If there is any ack, there is a bug.
28 */
29 BUG("ack with noop negotiator, which does not emit any commits");
30 return 0;
31 }
32
33 static void release(struct fetch_negotiator *n UNUSED)
34 {
35 /* nothing to release */
36 }
37
38 void noop_negotiator_init(struct fetch_negotiator *negotiator)
39 {
40 negotiator->known_common = known_common;
41 negotiator->add_tip = add_tip;
42 negotiator->next = next;
43 negotiator->ack = ack;
44 negotiator->release = release;
45 negotiator->data = NULL;
46 }