Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/fetch-pack.h # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / fetch-pack.h` 122 lines ยท 3848 bytes Raw Blame History 1 #ifndef FETCH_PACK_H 2 #define FETCH_PACK_H 3 4 #include "string-list.h" 5 #include "protocol.h" 6 #include "list-objects-filter-options.h" 7 #include "oidset.h" 8 9 struct oid_array; 10 11 struct fetch_pack_args { 12 const char *uploadpack; 13 int unpacklimit; 14 int depth; 15 const char *deepen_since; 16 const struct string_list *deepen_not; 17 struct list_objects_filter_options filter_options; 18 const struct string_list *server_options; 19 20 /* 21 * If not NULL, during packfile negotiation, fetch-pack will send "have" 22 * lines for all _include_ tips and then a subset of the _restrict_ tips. 23 */ 24 const struct oid_array *negotiation_restrict_tips; 25 const struct oid_array *negotiation_include_tips; 26 27 unsigned deepen_relative:1; 28 unsigned quiet:1; 29 unsigned keep_pack:1; 30 unsigned lock_pack:1; 31 unsigned use_thin_pack:1; 32 unsigned fetch_all:1; 33 unsigned stdin_refs:1; 34 unsigned diag_url:1; 35 unsigned verbose:1; 36 unsigned no_progress:1; 37 unsigned include_tag:1; 38 unsigned stateless_rpc:1; 39 unsigned check_self_contained_and_connected:1; 40 unsigned self_contained_and_connected:1; 41 unsigned cloning:1; 42 unsigned update_shallow:1; 43 unsigned reject_shallow_remote:1; 44 unsigned deepen:1; 45 unsigned refetch:1; 46 47 /* 48 * Indicate that the remote of this request is a promisor remote. The 49 * pack received does not need all referred-to objects to be present in 50 * the local object store, and fetch-pack will store the pack received 51 * together with a ".promisor" file indicating that the aforementioned 52 * pack is a promisor pack. 53 */ 54 unsigned from_promisor:1; 55 56 /* 57 * Because fetch_pack() overwrites the shallow file upon a 58 * successful deepening non-clone fetch, if this struct 59 * specifies such a fetch, fetch_pack() needs to perform a 60 * connectivity check before deciding if a fetch is successful 61 * (and overwriting the shallow file). fetch_pack() sets this 62 * field to 1 if such a connectivity check was performed. 63 * 64 * This is different from check_self_contained_and_connected 65 * in that the former allows existing objects in the 66 * repository to satisfy connectivity needs, whereas the 67 * latter doesn't. 68 */ 69 unsigned connectivity_checked:1; 70 }; 71 72 /* 73 * sought represents remote references that should be updated from. 74 * On return, the names that were found on the remote will have been 75 * marked as such. 76 */ 77 struct ref *fetch_pack(struct fetch_pack_args *args, 78 int fd[], 79 const struct ref *ref, 80 struct ref **sought, 81 int nr_sought, 82 struct oid_array *shallow, 83 struct string_list *pack_lockfiles, 84 enum protocol_version version); 85 86 /* 87 * Execute the --negotiate-only mode of "git fetch", adding all known common 88 * commits to acked_commits. 89 * 90 * In the capability advertisement that has happened prior to invoking this 91 * function, the "wait-for-done" capability must be present. 92 */ 93 void negotiate_using_fetch(const struct oid_array *negotiation_restrict_tips, 94 const struct string_list *server_options, 95 int stateless_rpc, 96 int fd[], 97 struct oidset *acked_commits, 98 const struct oid_array *negotiation_include_tips); 99 100 /* 101 * Print an appropriate error message for each sought ref that wasn't 102 * matched. Return 0 if all sought refs were matched, otherwise 1. 103 */ 104 int report_unmatched_refs(struct ref **sought, int nr_sought); 105 106 /* 107 * Return true if checks for broken objects in received pack are required. 108 */ 109 int fetch_pack_fsck_objects(void); 110 111 /* 112 * Check if the provided config variable pertains to fetch fsck and if so append 113 * the configuration to the provided strbuf. 114 * 115 * When a fetch fsck config option is successfully processed the function 116 * returns 0. If the provided config option is unrelated to fetch fsck, 1 is 117 * returned. Errors return -1. 118 */ 119 int fetch_pack_fsck_config(const char *var, const char *value, 120 struct strbuf *msg_types); 121 122 #endif