builtin/clone.c: add --reject-shallow option
In some scenarios, users may want more history than the repository offered for cloning, which happens to be a shallow repository, can give them. But because users don't know it is a shallow repository until they download it to local, we may want to refuse to clone this kind of repository, without creating any unnecessary files. The '--depth=x' option cannot be used as a solution; the source may be deep enough to give us 'x' commits when cloned, but the user may later need to deepen the history to arbitrary depth. Teach '--reject-shallow' option to "git clone" to abort as soon as we find out that we are cloning from a shallow repository. Signed-off-by: Li Linchao <lilinchao@oschina.cn> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
84d06cdc06
commit
4fe788b1b0
@ -39,6 +39,7 @@ struct fetch_pack_args {
|
||||
unsigned self_contained_and_connected:1;
|
||||
unsigned cloning:1;
|
||||
unsigned update_shallow:1;
|
||||
unsigned reject_shallow_remote:1;
|
||||
unsigned deepen:1;
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user