Explorar el Código

Create required refs directories if they don't exist yet.

Jelmer Vernooij hace 16 años
padre
commit
f042e6ce51
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      dulwich/repo.py

+ 3 - 0
dulwich/repo.py

@@ -245,6 +245,9 @@ class Repo(object):
 
     def set_ref(self, name, value):
         file = os.path.join(self.controldir(), name)
+        dirpath = os.path.dirname(file)
+        if not os.path.exists(dirpath):
+            os.makedirs(dirpath)
         f = open(file, 'w')
         try:
             f.write(value+"\n")