Coverage Report

Created: 2024-09-08 06:23

/src/git/negotiator/noop.c
Line
Count
Source (jump to first uncovered line)
1
#include "git-compat-util.h"
2
#include "noop.h"
3
#include "../fetch-negotiator.h"
4
5
static void known_common(struct fetch_negotiator *n UNUSED,
6
       struct commit *c UNUSED)
7
0
{
8
  /* do nothing */
9
0
}
10
11
static void add_tip(struct fetch_negotiator *n UNUSED,
12
        struct commit *c UNUSED)
13
0
{
14
  /* do nothing */
15
0
}
16
17
static const struct object_id *next(struct fetch_negotiator *n UNUSED)
18
0
{
19
0
  return NULL;
20
0
}
21
22
static int ack(struct fetch_negotiator *n UNUSED, struct commit *c UNUSED)
23
0
{
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
0
  BUG("ack with noop negotiator, which does not emit any commits");
29
0
  return 0;
30
0
}
31
32
static void release(struct fetch_negotiator *n UNUSED)
33
0
{
34
  /* nothing to release */
35
0
}
36
37
void noop_negotiator_init(struct fetch_negotiator *negotiator)
38
0
{
39
0
  negotiator->known_common = known_common;
40
0
  negotiator->add_tip = add_tip;
41
0
  negotiator->next = next;
42
0
  negotiator->ack = ack;
43
0
  negotiator->release = release;
44
0
  negotiator->data = NULL;
45
0
}