Infrastructure for current directory handling
[stgit] / stgit / commands / clone.py
index 9ad76a6..a150010 100644 (file)
@@ -23,12 +23,13 @@ from stgit.utils import *
 from stgit import stack, git
 
 
-help = 'clone a remote repository into local storage'
+help = 'make a local clone of a remote repository'
 usage = """%prog [options] <repository> <dir>
 
 Clone a GIT <repository> into the local <dir> and initialise the
 patch stack."""
 
+directory = DirectoryAnywhere()
 options = []
 
 
@@ -51,6 +52,9 @@ def func(parser, options, args):
     os.chdir(local_dir)
     git.checkout(tree_id = 'HEAD')
 
+    # be sure to forget any cached value for .git, since we're going
+    # to work on a brand new repository
+    basedir.clear_cache()
     stack.Series().init()
 
     print 'done'