]> scripts.mit.edu Git - wizard.git/blobdiff - lib/wizard/command/migrate.py
Downgrade AlreadyMigratedError to result in an informational notice.
[wizard.git] / lib / wizard / command / migrate.py
index dc5f5aa265971850dc608d04913a8773e2009ee3..056d4482de6d6295fb346e357b72dccb42c6eb73 100644 (file)
@@ -107,10 +107,10 @@ what repository and tag to use."""
         else:
             if os.path.isdir(".git"):
                 logger.warning("Force removing .git directory")
-                shutil.rmtree(".git")
+                if not options.dry_run: shutil.rmtree(".git")
             if os.path.isdir(".scripts"):
                 logger.warning("Force removing .scripts directory")
-                shutil.rmtree(".scripts")
+                if not options.dry_run: shutil.rmtree(".scripts")
     try:
         deploy = wd.Deployment.fromDir(".")
         version = deploy.getAppVersion()
@@ -138,7 +138,7 @@ what repository and tag to use."""
     did_git_checkout_scripts = False
     try:
         # create repository
-        shell.call("git", "init")
+        shell.call("git", "--git-dir=.git", "init")
         did_git_init = True
         # configure our remote
         shell.call("git", "remote", "add", "origin", repo)
@@ -148,7 +148,7 @@ what repository and tag to use."""
         # perform the initial fetch
         shell.call("git", "fetch", "origin")
         # soft reset to our tag
-        shell.call("git", "reset", tag)
+        shell.call("git", "reset", tag, "--")
         # checkout the .scripts directory
         shell.call("git", "checkout", ".scripts")
         did_git_checkout_scripts = True