diff options
author | Junio C Hamano <junkio@cox.net> | 2005-10-12 18:12:27 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2005-10-12 18:32:03 -0700 |
commit | 64c381bf740a0a698fe7556fbb346b700b934f7c (patch) | |
tree | 1970e5869a42fd4095917d861654dc84d60f02b7 /clone-pack.c | |
parent | 11dcec07a4815b7a37e009df1e8007d7ec08becf (diff) | |
download | git-64c381bf740a0a698fe7556fbb346b700b934f7c.tar.gz |
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>
Diffstat (limited to 'clone-pack.c')
-rw-r--r-- | clone-pack.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clone-pack.c b/clone-pack.c index 9567900aab..9a3371e1b2 100644 --- a/clone-pack.c +++ b/clone-pack.c @@ -5,7 +5,8 @@ static int quiet; 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 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), "%s/pack/pack-%s.pack", get_object_directory(), hash); move_temp_to_file(pack_tmp_name, final); + chmod(final, 0444); snprintf(final, sizeof(final), "%s/pack/pack-%s.idx", get_object_directory(), hash); move_temp_to_file(idx, final); + chmod(final, 0444); return 0; error_die: |