clone-pack: new option --keep tells it not to explode the pack.
With new option --keep, or a configuration item clone.keeppack (we need a better name, or start allowing dash,"clone.keep-pack"), the packed data downloaded while cloning is saved as a pack in .git/objects/pack/ locally, with index generated for it with git-index-pack. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
@ -8,7 +8,7 @@ git-clone-pack - Clones a repository by receiving packed objects.
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
'git-clone-pack' [-q] [--exec=<git-upload-pack>] [<host>:]<directory> [<head>...]
|
'git-clone-pack' [-q] [--keep] [--exec=<git-upload-pack>] [<host>:]<directory> [<head>...]
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
-----------
|
-----------
|
||||||
@ -23,6 +23,11 @@ OPTIONS
|
|||||||
Pass '-q' flag to 'git-unpack-objects'; this makes the
|
Pass '-q' flag to 'git-unpack-objects'; this makes the
|
||||||
cloning process less verbose.
|
cloning process less verbose.
|
||||||
|
|
||||||
|
--keep::
|
||||||
|
Do not invoke 'git-unpack-objects' on received data, but
|
||||||
|
create a single packfile out of it instead, and store it
|
||||||
|
in the object database.
|
||||||
|
|
||||||
--exec=<git-upload-pack>::
|
--exec=<git-upload-pack>::
|
||||||
Use this to specify the path to 'git-upload-pack' on the
|
Use this to specify the path to 'git-upload-pack' on the
|
||||||
remote side, if it is not found on your $PATH.
|
remote side, if it is not found on your $PATH.
|
||||||
|
@ -5,7 +5,8 @@
|
|||||||
|
|
||||||
static int quiet;
|
static int quiet;
|
||||||
static int keep_pack;
|
static int keep_pack;
|
||||||
static const char clone_pack_usage[] = "git-clone-pack [-q] [--exec=<git-upload-pack>] [<host>:]<directory> [<heads>]*";
|
static const char clone_pack_usage[] =
|
||||||
|
"git-clone-pack [-q] [--keep] [--exec=<git-upload-pack>] [<host>:]<directory> [<heads>]*";
|
||||||
static const char *exec = "git-upload-pack";
|
static const char *exec = "git-upload-pack";
|
||||||
|
|
||||||
static void clone_handshake(int fd[2], struct ref *ref)
|
static void clone_handshake(int fd[2], struct ref *ref)
|
||||||
@ -221,9 +222,11 @@ static int finish_pack(const char *pack_tmp_name)
|
|||||||
snprintf(final, sizeof(final),
|
snprintf(final, sizeof(final),
|
||||||
"%s/pack/pack-%s.pack", get_object_directory(), hash);
|
"%s/pack/pack-%s.pack", get_object_directory(), hash);
|
||||||
move_temp_to_file(pack_tmp_name, final);
|
move_temp_to_file(pack_tmp_name, final);
|
||||||
|
chmod(final, 0444);
|
||||||
snprintf(final, sizeof(final),
|
snprintf(final, sizeof(final),
|
||||||
"%s/pack/pack-%s.idx", get_object_directory(), hash);
|
"%s/pack/pack-%s.idx", get_object_directory(), hash);
|
||||||
move_temp_to_file(idx, final);
|
move_temp_to_file(idx, final);
|
||||||
|
chmod(final, 0444);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error_die:
|
error_die:
|
||||||
|
Reference in New Issue
Block a user