by
Changes to 3 files · Browse files at 25250c1694da Showing diff from parent 2bcbc61672e5 06fbcb6ae8a6 Diff from another changeset...
@@ -29,6 +29,9 @@ the previous one. (Yifan Zhang, issue #59)
* Handle None elements in lists of TreeChange objects. (Alex Holmes)
+
+ * Support cloning repositories without HEAD set.
+ (D-Key, Jelmer Vernooij, issue #69)
0.8.5 2012-03-29
|
@@ -1383,14 +1383,15 @@
# Update target head
head, head_sha = self.refs._follow('HEAD')
- 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 head is not None and head_sha is not None:
+ 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)
return target
|
Loading...