builtin-clone: fix initial checkout
Somewhere in the process of finishing up builtin-clone, the update of the working tree was lost. This was due to not using the option "merge" for unpack_trees(). Breakage noticed by Kevin Ballard. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Tested-by: Jeff King <peff@peff.net> Acked-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin committed
May 15, 2008 at 10:48 UTC
a73bc1275bb0939c51c496b1d50c516e6314eab2
2 files changed
+10
builtin-clone.c
+3
@@ -525,7 +525,10 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
525
526
memset(&opts, 0, sizeof opts);
527
opts.update = 1;
528
+ opts.merge = 1;
529
+ opts.fn = oneway_merge;
530
opts.verbose_update = !option_quiet;
531
+ opts.src_index = &the_index;
532
opts.dst_index = &the_index;
533
534
tree = parse_tree_indirect(remote_head->old_sha1);
t/t5601-clone.sh
+7
@@ -23,4 +23,11 @@ test_expect_success 'clone with excess parameters' '
23
24
'
25
26
+test_expect_success 'clone checks out files' '
27
+
28
+ git clone src dst &&
29
+ test -f dst/file
30
+
31
+'
32
+
33
test_done