summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0b294c0)
raw | patch | inline | side by side (parent: 0b294c0)
author | Shawn O. Pearce <spearce@spearce.org> | |
Tue, 8 Jul 2008 04:46:06 +0000 (04:46 +0000) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 8 Jul 2008 21:47:04 +0000 (14:47 -0700) |
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>
.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>
builtin-clone.c | patch | blob | history | |
t/t5601-clone.sh | patch | blob | history |
diff --git a/builtin-clone.c b/builtin-clone.c
index 7bcc664e44cb684e150221e9c9c4d0fe54357011..7ee82752699f837f89fcbea06b1a20aa286ae6cb 100644 (file)
--- a/builtin-clone.c
+++ b/builtin-clone.c
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;
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);
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;
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index b642fb260b37a7be2bcd37ea22ba2097e26f07a2..d785b3df78e8507d81ffa03ff694846791edfc87 100755 (executable)
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
'
-test_expect_success 'clone with excess parameters' '
+test_expect_success 'clone with excess parameters (1)' '
+ rm -fr dst &&
+ test_must_fail git clone -n src dst junk
+
+'
+
+test_expect_success 'clone with excess parameters (2)' '
+
+ rm -fr dst &&
test_must_fail git clone -n "file://$(pwd)/src" dst junk
'
+test_expect_success 'clone does not keep pack' '
+
+ rm -fr dst &&
+ git clone -n "file://$(pwd)/src" dst &&
+ ! test -f dst/file &&
+ ! (echo dst/.git/objects/pack/pack-* | grep "\.keep")
+
+'
+
test_expect_success 'clone checks out files' '
+ rm -fr dst &&
git clone src dst &&
test -f dst/file