mirror of
https://github.com/git/git.git
synced 2024-11-26 03:14:50 +08:00
92251b1b5b
Fetching from a shallow-cloned repository used to be forbidden, primarily because the codepaths involved were not carefully vetted and we did not bother supporting such usage. This attempts to allow object transfer out of a shallow-cloned repository in a controlled way (i.e. the receiver become a shallow repository with truncated history). * nd/shallow-clone: (31 commits) t5537: fix incorrect expectation in test case 10 shallow: remove unused code send-pack.c: mark a file-local function static git-clone.txt: remove shallow clone limitations prune: clean .git/shallow after pruning objects clone: use git protocol for cloning shallow repo locally send-pack: support pushing from a shallow clone via http receive-pack: support pushing to a shallow clone via http smart-http: support shallow fetch/clone remote-curl: pass ref SHA-1 to fetch-pack as well send-pack: support pushing to a shallow clone receive-pack: allow pushes that update .git/shallow connected.c: add new variant that runs with --shallow-file add GIT_SHALLOW_FILE to propagate --shallow-file to subprocesses receive/send-pack: support pushing from a shallow clone receive-pack: reorder some code in unpack() fetch: add --update-shallow to accept refs that update .git/shallow upload-pack: make sure deepening preserves shallow roots fetch: support fetching from a shallow repository clone: support remote shallow repository ...
45 lines
1.0 KiB
C
45 lines
1.0 KiB
C
#ifndef FETCH_PACK_H
|
|
#define FETCH_PACK_H
|
|
|
|
#include "string-list.h"
|
|
#include "run-command.h"
|
|
|
|
struct sha1_array;
|
|
|
|
struct fetch_pack_args {
|
|
const char *uploadpack;
|
|
int unpacklimit;
|
|
int depth;
|
|
unsigned quiet:1;
|
|
unsigned keep_pack:1;
|
|
unsigned lock_pack:1;
|
|
unsigned use_thin_pack:1;
|
|
unsigned fetch_all:1;
|
|
unsigned stdin_refs:1;
|
|
unsigned diag_url:1;
|
|
unsigned verbose:1;
|
|
unsigned no_progress:1;
|
|
unsigned include_tag:1;
|
|
unsigned stateless_rpc:1;
|
|
unsigned check_self_contained_and_connected:1;
|
|
unsigned self_contained_and_connected:1;
|
|
unsigned cloning:1;
|
|
unsigned update_shallow:1;
|
|
};
|
|
|
|
/*
|
|
* sought represents remote references that should be updated from.
|
|
* On return, the names that were found on the remote will have been
|
|
* marked as such.
|
|
*/
|
|
struct ref *fetch_pack(struct fetch_pack_args *args,
|
|
int fd[], struct child_process *conn,
|
|
const struct ref *ref,
|
|
const char *dest,
|
|
struct ref **sought,
|
|
int nr_sought,
|
|
struct sha1_array *shallow,
|
|
char **pack_lockfile);
|
|
|
|
#endif
|