Skip to content

Commit

Permalink
git-cvsimport: force checkout of working tree after initial import
Browse files Browse the repository at this point in the history
When creating a brand new git repository through git-cvsimport (not
incremental import), force a checkout of HEAD of master as working tree
after successful import using the -f switch to git checkout.  Otherwise
the working tree is empty, and all files are reported as 'deleted' by
git status.

This was noticed and reported by Cameron Dale through
 http://bugs.debian.org/430903

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Gerrit Pape authored and Junio C Hamano committed Jun 29, 2007
1 parent f578825 commit 7051c3b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion git-cvsimport.perl
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ sub commit {
if ($opt_r && $opt_o ne 'HEAD');
system('git-update-ref', 'HEAD', "$orig_branch");
unless ($opt_i) {
system('git checkout');
system('git checkout -f');
die "checkout failed: $?\n" if $?;
}
}

0 comments on commit 7051c3b

Please sign in to comment.