hgext/largefiles/lfutil.py
changeset 21917 ac3b3a2d976d
parent 21085 66c6da0bc7e2
child 22095 cb62d77c7a01
--- a/hgext/largefiles/lfutil.py	Tue Nov 05 14:47:35 2013 -0500
+++ b/hgext/largefiles/lfutil.py	Thu Jul 17 20:17:17 2014 -0400
@@ -123,9 +123,13 @@
     # it. This ensures that we create it on the first meaningful
     # largefiles operation in a new clone.
     if create and not os.path.exists(os.path.join(lfstoredir, 'dirstate')):
-        util.makedirs(lfstoredir)
         matcher = getstandinmatcher(repo)
-        for standin in repo.dirstate.walk(matcher, [], False, False):
+        standins = repo.dirstate.walk(matcher, [], False, False)
+
+        if len(standins) > 0:
+            util.makedirs(lfstoredir)
+
+        for standin in standins:
             lfile = splitstandin(standin)
             lfdirstate.normallookup(lfile)
     return lfdirstate