Skip to content

Commit

Permalink
builtin-clone: fix initial checkout
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Schindelin authored and Junio C Hamano committed May 15, 2008
1 parent 8434c2f commit a73bc12
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions builtin-clone.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,10 @@ int cmd_clone(int argc, const char **argv, const char *prefix)

memset(&opts, 0, sizeof opts);
opts.update = 1;
opts.merge = 1;
opts.fn = oneway_merge;
opts.verbose_update = !option_quiet;
opts.src_index = &the_index;
opts.dst_index = &the_index;

tree = parse_tree_indirect(remote_head->old_sha1);
Expand Down
7 changes: 7 additions & 0 deletions t/t5601-clone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,11 @@ test_expect_success 'clone with excess parameters' '
'

test_expect_success 'clone checks out files' '
git clone src dst &&
test -f dst/file
'

test_done

0 comments on commit a73bc12

Please sign in to comment.