changeset 263:9f5a7a5d52aa

Enable detection of bare repositories as a local git repo
author Lincoln Stoll <lstoll@lstoll.net>
date Mon, 26 Oct 2009 17:52:32 +0100
parents fdb8065e2eac
children 3caa2ce52cd9
files hggit/__init__.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hggit/__init__.py
+++ b/hggit/__init__.py
@@ -36,6 +36,12 @@
     if (os.path.exists(os.path.join(p, '.git')) and 
         not os.path.exists(os.path.join(p, '.hg'))):
         return gitrepo
+    # detect a bare repository
+    if (os.path.exists(os.path.join(p, 'HEAD')) and 
+        os.path.exists(os.path.join(p, 'objects')) and 
+        os.path.exists(os.path.join(p, 'refs')) and 
+        not os.path.exists(os.path.join(p, '.hg'))):
+        return gitrepo
     return _oldlocal(path)
 
 hg.schemes['file'] = _local