git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] git-cvsimport: force checkout of working tree after initial import

From
Gerrit Pape <pape@smarden.org>
Date
Jun 28, 2007, 11:12 UTC
Message-ID
<20070628111207.28276.qmail@a0ecab5969a5b1.315fe32.mid.smarden.org>

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>
---
 git-cvsimport.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index 69ccb88..ba23eb8 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -1007,7 +1007,7 @@ if ($orig_branch) {
 		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 $?;
 	}
 }
-- 
1.5.2.1
Next: Junio C Hamano
Message 1 of 2 in “git-cvsimport: force checkout of working tree after initial import”
  1. git-cvsimport: force checkout of working tree after initial importGerrit Pape, Jun 28, 2007
  2. Junio C HamanoJun 29, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.