From: Evan Broder <broder@mit.edu>
Date: Mon, 22 Dec 2008 07:19:31 +0000 (-0500)
Subject: Make the git checkout a bare repo, because git-svn won't do that.
X-Git-Url: http://xvm.mit.edu/gitweb/invirt/scripts/git-migration.git/commitdiff_plain/be5ab10e51ca56dc04931a437f3e4d0cd5e55870

Make the git checkout a bare repo, because git-svn won't do that.

svn path=/trunk/scripts/git-migration/; revision=1869
---

diff --git a/git-migrate b/git-migrate
index b8d0f0f..911044e 100755
--- a/git-migrate
+++ b/git-migrate
@@ -2,12 +2,18 @@
 
 import sys
 import subprocess
+import shutil
 
 def clonePackage(base, pkg):
     # Use --no-follow-parent because we're going to handle that with
     # grafts.
     subprocess.check_call(['git', 'svn', 'clone', '--no-follow-parent', '%s/packages/%s' % (base, pkg)],
                     stdout=subprocess.PIPE)
+    
+    # Then make the repository bare, because git-svn can't do this
+    shutil.move('%s/.git' % pkg, '%s.git' % pkg)
+    shutil.rmtree('%s' % pkg)
+    subprocess.check_call(['git', 'config', 'core.bare', 'true'], cwd='%s.git' % pkg)
 
 def cloneAllPackages(base):
     for pkg in open('package-list'):