浏览代码

Don't create a working tree if there is no HEAD in Repo.clone.

Jelmer Vernooij 12 年之前
父节点
当前提交
06fbcb6ae8
共有 1 个文件被更改,包括 5 次插入5 次删除
  1. 5 5
      dulwich/repo.py

+ 5 - 5
dulwich/repo.py

@@ -1387,11 +1387,11 @@ class Repo(BaseRepo):
             target.refs.set_symbolic_ref('HEAD', head)
             target['HEAD'] = head_sha
 
-        if not bare:
-            # Checkout HEAD to target dir
-            from dulwich.index import build_index_from_tree
-            build_index_from_tree(target.path, target.index_path(),
-                    target.object_store, target['HEAD'].tree)
+            if not bare:
+                # Checkout HEAD to target dir
+                from dulwich.index import build_index_from_tree
+                build_index_from_tree(target.path, target.index_path(),
+                        target.object_store, target['HEAD'].tree)
 
         return target