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; 19unsigned deepen_relative:1; 20unsigned quiet:1; 21unsigned keep_pack:1; 22unsigned lock_pack:1; 23unsigned use_thin_pack:1; 24unsigned fetch_all:1; 25unsigned stdin_refs:1; 26unsigned diag_url:1; 27unsigned verbose:1; 28unsigned no_progress:1; 29unsigned include_tag:1; 30unsigned stateless_rpc:1; 31unsigned check_self_contained_and_connected:1; 32unsigned self_contained_and_connected:1; 33unsigned cloning:1; 34unsigned update_shallow:1; 35unsigned deepen:1; 36unsigned from_promisor:1; 37 38/* 39 * If 1, fetch_pack() will also not modify any object flags. 40 * This allows fetch_pack() to safely be called by any function, 41 * regardless of which object flags it uses (if any). 42 */ 43unsigned no_dependents:1; 44 45/* 46 * Because fetch_pack() overwrites the shallow file upon a 47 * successful deepening non-clone fetch, if this struct 48 * specifies such a fetch, fetch_pack() needs to perform a 49 * connectivity check before deciding if a fetch is successful 50 * (and overwriting the shallow file). fetch_pack() sets this 51 * field to 1 if such a connectivity check was performed. 52 * 53 * This is different from check_self_contained_and_connected 54 * in that the former allows existing objects in the 55 * repository to satisfy connectivity needs, whereas the 56 * latter doesn't. 57 */ 58unsigned connectivity_checked:1; 59}; 60 61/* 62 * sought represents remote references that should be updated from. 63 * On return, the names that were found on the remote will have been 64 * marked as such. 65 */ 66struct ref *fetch_pack(struct fetch_pack_args *args, 67int fd[],struct child_process *conn, 68const struct ref *ref, 69const char*dest, 70struct ref **sought, 71int nr_sought, 72struct oid_array *shallow, 73char**pack_lockfile, 74enum protocol_version version); 75 76/* 77 * Print an appropriate error message for each sought ref that wasn't 78 * matched. Return 0 if all sought refs were matched, otherwise 1. 79 */ 80intreport_unmatched_refs(struct ref **sought,int nr_sought); 81 82#endif