aboutsummaryrefslogtreecommitdiff
path: root/builtin-clone.c
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2008-07-08 04:46:06 +0000
committerJunio C Hamano <gitster@pobox.com>2008-07-08 14:47:04 -0700
commit1db4a75c8d18d8827ac710e87219b349558d9196 (patch)
tree6c361b248445f35e3e5cae314cdcf68ca4960fc6 /builtin-clone.c
parent0b294c0abf00a9cf7468e0ea62722ae23b0816cc (diff)
downloadgit-1db4a75c8d18d8827ac710e87219b349558d9196.tar.gz
git-1db4a75c8d18d8827ac710e87219b349558d9196.tar.xz
Remove unnecessary pack-*.keep file after successful git-clone
Once a clone is successful we no longer need to hold onto the .keep file created by the transport. Delete the file so we can later repack the complete repository. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-clone.c')
-rw-r--r--builtin-clone.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/builtin-clone.c b/builtin-clone.c
index 7bcc664e4..7ee827526 100644
--- a/builtin-clone.c
+++ b/builtin-clone.c
@@ -337,6 +337,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
const struct ref *refs, *head_points_at, *remote_head, *mapped_refs;
char branch_top[256], key[256], value[256];
struct strbuf reflog_msg;
+ struct transport *transport = NULL;
struct refspec refspec;
@@ -458,8 +459,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
refs = clone_local(path, git_dir);
else {
struct remote *remote = remote_get(argv[0]);
- struct transport *transport =
- transport_get(remote, remote->url[0]);
+ transport = transport_get(remote, remote->url[0]);
if (!transport->get_refs_list || !transport->fetch)
die("Don't know how to clone %s", transport->url);
@@ -529,6 +529,9 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
option_no_checkout = 1;
}
+ if (transport)
+ transport_unlock_pack(transport);
+
if (!option_no_checkout) {
struct lock_file *lock_file = xcalloc(1, sizeof(struct lock_file));
struct unpack_trees_options opts;