summaryrefslogtreecommitdiff
path: root/git/db/py/base.py
diff options
context:
space:
mode:
Diffstat (limited to 'git/db/py/base.py')
-rw-r--r--git/db/py/base.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/git/db/py/base.py b/git/db/py/base.py
index cc326c27..74b8beb9 100644
--- a/git/db/py/base.py
+++ b/git/db/py/base.py
@@ -20,6 +20,7 @@ from git.util import (
is_git_dir
)
+from git.index import IndexFile
from git.config import GitConfigParser
from git.exc import (
BadObject,
@@ -35,7 +36,8 @@ import os
__all__ = ( 'PureObjectDBR', 'PureObjectDBW', 'PureRootPathDB', 'PureCompoundDB',
- 'PureConfigurationMixin', 'PureRepositoryPathsMixin', 'PureAlternatesFileMixin')
+ 'PureConfigurationMixin', 'PureRepositoryPathsMixin', 'PureAlternatesFileMixin',
+ 'PureIndexDB')
class PureObjectDBR(ObjectDBR):
@@ -386,6 +388,16 @@ class PureConfigurationMixin(ConfigurationMixin):
#} END interface
+class PureIndexDB(IndexDB):
+ #{ Configuration
+ IndexCls = IndexFile
+ #} END configuration
+
+ @property
+ def index(self):
+ return self.IndexCls(self)
+
+
class PureAlternatesFileMixin(object):
"""Utility able to read and write an alternates file through the alternates property
It needs to be part of a type with the git_dir or db_path property.