1#ifndef FETCH_PACK_H 2#define FETCH_PACK_H 3 4#include"string-list.h" 5#include"run-command.h" 6#include"protocol.h" 7#include"list-objects-filter-options.h" 8 9struct oid_array; 10 11struct fetch_pack_args { 12const char*uploadpack; 13int unpacklimit; 14int depth; 15const char*deepen_since; 16const struct string_list *deepen_not; 17struct list_objects_filter_options filter_options; 18const struct string_list *server_options; 19 20/* 21 * If not NULL, during packfile negotiation, fetch-pack will send "have" 22 * lines only with these tips and their ancestors. 23 */ 24const struct oid_array *negotiation_tips; 25 26unsigned deepen_relative:1; 27unsigned quiet:1; 28unsigned keep_pack:1; 29unsigned lock_pack:1; 30unsigned use_thin_pack:1; 31unsigned fetch_all:1; 32unsigned stdin_refs:1; 33unsigned diag_url:1; 34unsigned verbose:1; 35unsigned no_progress:1; 36unsigned include_tag:1; 37unsigned stateless_rpc:1; 38unsigned check_self_contained_and_connected:1; 39unsigned self_contained_and_connected:1; 40unsigned cloning:1; 41unsigned update_shallow:1; 42unsigned deepen:1; 43unsigned from_promisor:1; 44 45/* 46 * Attempt to fetch only the wanted objects, and not any objects 47 * referred to by them. Due to protocol limitations, extraneous 48 * objects may still be included. (When fetching non-blob 49 * objects, only blobs are excluded; when fetching a blob, the 50 * blob itself will still be sent. The client does not need to 51 * know whether a wanted object is a blob or not.) 52 * 53 * If 1, fetch_pack() will also not modify any object flags. 54 * This allows fetch_pack() to safely be called by any function, 55 * regardless of which object flags it uses (if any). 56 */ 57unsigned no_dependents:1; 58 59/* 60 * Because fetch_pack() overwrites the shallow file upon a 61 * successful deepening non-clone fetch, if this struct 62 * specifies such a fetch, fetch_pack() needs to perform a 63 * connectivity check before deciding if a fetch is successful 64 * (and overwriting the shallow file). fetch_pack() sets this 65 * field to 1 if such a connectivity check was performed. 66 * 67 * This is different from check_self_contained_and_connected 68 * in that the former allows existing objects in the 69 * repository to satisfy connectivity needs, whereas the 70 * latter doesn't. 71 */ 72unsigned connectivity_checked:1; 73}; 74 75/* 76 * sought represents remote references that should be updated from. 77 * On return, the names that were found on the remote will have been 78 * marked as such. 79 */ 80struct ref *fetch_pack(struct fetch_pack_args *args, 81int fd[], 82const struct ref *ref, 83struct ref **sought, 84int nr_sought, 85struct oid_array *shallow, 86char**pack_lockfile, 87enum protocol_version version); 88 89/* 90 * Print an appropriate error message for each sought ref that wasn't 91 * matched. Return 0 if all sought refs were matched, otherwise 1. 92 */ 93intreport_unmatched_refs(struct ref **sought,int nr_sought); 94 95#endif