diff hggit/__init__.py @ 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 6977263c4d80
children d0594f7675e1
line wrap: on
line diff
--- a/hggit/__init__.py	Tue Oct 20 19:33:06 2009 +0200
+++ b/hggit/__init__.py	Mon Oct 26 17:52:32 2009 +0100
@@ -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