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