2023-02-24 00:09:30 +00:00
|
|
|
#include "git-compat-util.h"
|
2020-08-18 04:01:31 +00:00
|
|
|
#include "noop.h"
|
|
|
|
#include "../fetch-negotiator.h"
|
|
|
|
|
2023-08-29 23:45:30 +00:00
|
|
|
static void known_common(struct fetch_negotiator *n UNUSED,
|
|
|
|
struct commit *c UNUSED)
|
2020-08-18 04:01:31 +00:00
|
|
|
{
|
|
|
|
/* do nothing */
|
|
|
|
}
|
|
|
|
|
2023-08-29 23:45:30 +00:00
|
|
|
static void add_tip(struct fetch_negotiator *n UNUSED,
|
|
|
|
struct commit *c UNUSED)
|
2020-08-18 04:01:31 +00:00
|
|
|
{
|
|
|
|
/* do nothing */
|
|
|
|
}
|
|
|
|
|
2023-08-29 23:45:30 +00:00
|
|
|
static const struct object_id *next(struct fetch_negotiator *n UNUSED)
|
2020-08-18 04:01:31 +00:00
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2023-08-29 23:45:30 +00:00
|
|
|
static int ack(struct fetch_negotiator *n UNUSED, struct commit *c UNUSED)
|
2020-08-18 04:01:31 +00:00
|
|
|
{
|
|
|
|
/*
|
|
|
|
* This negotiator does not emit any commits, so there is no commit to
|
|
|
|
* be acknowledged. If there is any ack, there is a bug.
|
|
|
|
*/
|
|
|
|
BUG("ack with noop negotiator, which does not emit any commits");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2023-08-29 23:45:30 +00:00
|
|
|
static void release(struct fetch_negotiator *n UNUSED)
|
2020-08-18 04:01:31 +00:00
|
|
|
{
|
|
|
|
/* nothing to release */
|
|
|
|
}
|
|
|
|
|
|
|
|
void noop_negotiator_init(struct fetch_negotiator *negotiator)
|
|
|
|
{
|
|
|
|
negotiator->known_common = known_common;
|
|
|
|
negotiator->add_tip = add_tip;
|
|
|
|
negotiator->next = next;
|
|
|
|
negotiator->ack = ack;
|
|
|
|
negotiator->release = release;
|
|
|
|
negotiator->data = NULL;
|
|
|
|
}
|