Fix fetch_object use of determine_wants. Fix repo.get_refs() - there might not be...
[jelmer/dulwich-libgit2.git] / dulwich / repo.py
index ba8cef51f241952c7ed7d7dbd450150944b526b0..e98ecf98bf6b76085d5c78203aaf256289328c20 100644 (file)
@@ -155,7 +155,9 @@ class Repo(object):
         return self._get_ref(file)
 
   def get_refs(self):
-    ret = {"HEAD": self.head()}
+    ret = {}
+    if self.head():
+        ret['HEAD'] = self.head()
     for dir in ["refs/heads", "refs/tags"]:
         for name in os.listdir(os.path.join(self.controldir(), dir)):
           path = os.path.join(self.controldir(), dir, name)