upload-pack: introduce fetch server command
[git/git.git] / fetch-pack.h
CommitLineData
2d4177c0
DB
1#ifndef FETCH_PACK_H
2#define FETCH_PACK_H
3
8bee93dd 4#include "string-list.h"
47a59185 5#include "run-command.h"
8bee93dd 6
910650d2 7struct oid_array;
beea4152 8
9cba13ca 9struct fetch_pack_args {
2d4177c0 10 const char *uploadpack;
2d4177c0 11 int unpacklimit;
2d4177c0 12 int depth;
508ea882 13 const char *deepen_since;
a45a2600 14 const struct string_list *deepen_not;
cccf74e2 15 unsigned deepen_relative:1;
f6486f07
NTND
16 unsigned quiet:1;
17 unsigned keep_pack:1;
18 unsigned lock_pack:1;
19 unsigned use_thin_pack:1;
20 unsigned fetch_all:1;
21 unsigned stdin_refs:1;
92251b1b 22 unsigned diag_url:1;
f6486f07
NTND
23 unsigned verbose:1;
24 unsigned no_progress:1;
25 unsigned include_tag:1;
26 unsigned stateless_rpc:1;
27 unsigned check_self_contained_and_connected:1;
28 unsigned self_contained_and_connected:1;
beea4152 29 unsigned cloning:1;
48d25cae 30 unsigned update_shallow:1;
79891cb9 31 unsigned deepen:1;
2d4177c0
DB
32};
33
4ba15999 34/*
f2db854d
JH
35 * sought represents remote references that should be updated from.
36 * On return, the names that were found on the remote will have been
37 * marked as such.
4ba15999 38 */
fa740529 39struct ref *fetch_pack(struct fetch_pack_args *args,
63c69453
MH
40 int fd[], struct child_process *conn,
41 const struct ref *ref,
42 const char *dest,
f2db854d
JH
43 struct ref **sought,
44 int nr_sought,
910650d2 45 struct oid_array *shallow,
63c69453 46 char **pack_lockfile);
2d4177c0 47
e860d96b
MM
48/*
49 * Print an appropriate error message for each sought ref that wasn't
50 * matched. Return 0 if all sought refs were matched, otherwise 1.
51 */
52int report_unmatched_refs(struct ref **sought, int nr_sought);
53
2d4177c0 54#endif