Daniel Barkalow | 2d4177c | 2007-09-10 23:03:00 -0400 | [diff] [blame] | 1 | #ifndef FETCH_PACK_H |
| 2 | #define FETCH_PACK_H |
| 3 | |
Michael Haggerty | 8bee93d | 2012-09-09 08:19:40 +0200 | [diff] [blame] | 4 | #include "string-list.h" |
Junio C Hamano | 47a5918 | 2013-07-08 13:56:53 -0700 | [diff] [blame] | 5 | #include "run-command.h" |
Brandon Williams | 685fbd3 | 2018-03-15 10:31:28 -0700 | [diff] [blame] | 6 | #include "protocol.h" |
Jeff Hostetler | 640d8b7 | 2017-12-08 15:58:40 +0000 | [diff] [blame] | 7 | #include "list-objects-filter-options.h" |
Michael Haggerty | 8bee93d | 2012-09-09 08:19:40 +0200 | [diff] [blame] | 8 | |
brian m. carlson | 910650d | 2017-03-31 01:40:00 +0000 | [diff] [blame] | 9 | struct oid_array; |
Nguyễn Thái Ngọc Duy | beea415 | 2013-12-05 20:02:39 +0700 | [diff] [blame] | 10 | |
Jonathan Nieder | 9cba13c | 2011-03-16 02:08:34 -0500 | [diff] [blame] | 11 | struct fetch_pack_args { |
Daniel Barkalow | 2d4177c | 2007-09-10 23:03:00 -0400 | [diff] [blame] | 12 | const char *uploadpack; |
Daniel Barkalow | 2d4177c | 2007-09-10 23:03:00 -0400 | [diff] [blame] | 13 | int unpacklimit; |
Daniel Barkalow | 2d4177c | 2007-09-10 23:03:00 -0400 | [diff] [blame] | 14 | int depth; |
Nguyễn Thái Ngọc Duy | 508ea88 | 2016-06-12 17:53:59 +0700 | [diff] [blame] | 15 | const char *deepen_since; |
Nguyễn Thái Ngọc Duy | a45a260 | 2016-06-12 17:54:04 +0700 | [diff] [blame] | 16 | const struct string_list *deepen_not; |
Jeff Hostetler | 640d8b7 | 2017-12-08 15:58:40 +0000 | [diff] [blame] | 17 | struct list_objects_filter_options filter_options; |
Brandon Williams | 5e3548e | 2018-04-23 15:46:24 -0700 | [diff] [blame] | 18 | const struct string_list *server_options; |
Nguyễn Thái Ngọc Duy | cccf74e | 2016-06-12 17:54:09 +0700 | [diff] [blame] | 19 | unsigned deepen_relative:1; |
Nguyễn Thái Ngọc Duy | f6486f0 | 2013-12-05 20:02:38 +0700 | [diff] [blame] | 20 | unsigned quiet:1; |
| 21 | unsigned keep_pack:1; |
| 22 | unsigned lock_pack:1; |
| 23 | unsigned use_thin_pack:1; |
| 24 | unsigned fetch_all:1; |
| 25 | unsigned stdin_refs:1; |
Junio C Hamano | 92251b1 | 2014-01-17 12:21:14 -0800 | [diff] [blame] | 26 | unsigned diag_url:1; |
Nguyễn Thái Ngọc Duy | f6486f0 | 2013-12-05 20:02:38 +0700 | [diff] [blame] | 27 | unsigned verbose:1; |
| 28 | unsigned no_progress:1; |
| 29 | unsigned include_tag:1; |
| 30 | unsigned stateless_rpc:1; |
| 31 | unsigned check_self_contained_and_connected:1; |
| 32 | unsigned self_contained_and_connected:1; |
Nguyễn Thái Ngọc Duy | beea415 | 2013-12-05 20:02:39 +0700 | [diff] [blame] | 33 | unsigned cloning:1; |
Nguyễn Thái Ngọc Duy | 48d25ca | 2013-12-05 20:02:42 +0700 | [diff] [blame] | 34 | unsigned update_shallow:1; |
Nguyễn Thái Ngọc Duy | 79891cb | 2016-06-12 17:53:56 +0700 | [diff] [blame] | 35 | unsigned deepen:1; |
Jonathan Tan | 88e2f9e | 2017-12-05 16:58:49 +0000 | [diff] [blame] | 36 | unsigned 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 | */ |
| 43 | unsigned no_dependents:1; |
Daniel Barkalow | 2d4177c | 2007-09-10 23:03:00 -0400 | [diff] [blame] | 44 | }; |
| 45 | |
Michael Haggerty | 4ba1599 | 2012-09-09 08:19:43 +0200 | [diff] [blame] | 46 | /* |
Junio C Hamano | f2db854 | 2013-01-29 14:02:15 -0800 | [diff] [blame] | 47 | * sought represents remote references that should be updated from. |
| 48 | * On return, the names that were found on the remote will have been |
| 49 | * marked as such. |
Michael Haggerty | 4ba1599 | 2012-09-09 08:19:43 +0200 | [diff] [blame] | 50 | */ |
Shawn O. Pearce | fa74052 | 2007-09-19 00:49:35 -0400 | [diff] [blame] | 51 | struct ref *fetch_pack(struct fetch_pack_args *args, |
Michael Haggerty | 63c6945 | 2012-09-09 08:19:39 +0200 | [diff] [blame] | 52 | int fd[], struct child_process *conn, |
| 53 | const struct ref *ref, |
| 54 | const char *dest, |
Junio C Hamano | f2db854 | 2013-01-29 14:02:15 -0800 | [diff] [blame] | 55 | struct ref **sought, |
| 56 | int nr_sought, |
brian m. carlson | 910650d | 2017-03-31 01:40:00 +0000 | [diff] [blame] | 57 | struct oid_array *shallow, |
Brandon Williams | 685fbd3 | 2018-03-15 10:31:28 -0700 | [diff] [blame] | 58 | char **pack_lockfile, |
| 59 | enum protocol_version version); |
Daniel Barkalow | 2d4177c | 2007-09-10 23:03:00 -0400 | [diff] [blame] | 60 | |
Matt McCutchen | e860d96 | 2017-02-22 11:01:22 -0500 | [diff] [blame] | 61 | /* |
| 62 | * Print an appropriate error message for each sought ref that wasn't |
| 63 | * matched. Return 0 if all sought refs were matched, otherwise 1. |
| 64 | */ |
| 65 | int report_unmatched_refs(struct ref **sought, int nr_sought); |
| 66 | |
Daniel Barkalow | 2d4177c | 2007-09-10 23:03:00 -0400 | [diff] [blame] | 67 | #endif |