git/fetch-pack.h

#ifndef FETCH_PACK_H
#define FETCH_PACK_H

#include "string-list.h"
#include "protocol.h"
#include "list-objects-filter-options.h"
#include "oidset.h"

struct oid_array;

struct fetch_pack_args {};

/*
 * sought represents remote references that should be updated from.
 * On return, the names that were found on the remote will have been
 * marked as such.
 */
struct ref *fetch_pack(struct fetch_pack_args *args,
		       int fd[],
		       const struct ref *ref,
		       struct ref **sought,
		       int nr_sought,
		       struct oid_array *shallow,
		       struct string_list *pack_lockfiles,
		       enum protocol_version version);

/*
 * Execute the --negotiate-only mode of "git fetch", adding all known common
 * commits to acked_commits.
 *
 * In the capability advertisement that has happened prior to invoking this
 * function, the "wait-for-done" capability must be present.
 */
void negotiate_using_fetch(const struct oid_array *negotiation_tips,
			   const struct string_list *server_options,
			   int stateless_rpc,
			   int fd[],
			   struct oidset *acked_commits);

/*
 * Print an appropriate error message for each sought ref that wasn't
 * matched.  Return 0 if all sought refs were matched, otherwise 1.
 */
int report_unmatched_refs(struct ref **sought, int nr_sought);

/*
 * Return true if checks for broken objects in received pack are required.
 */
int fetch_pack_fsck_objects(void);

#endif