'Create a pack index object.
Provide it with the name of the index file to consider, and it will map
it whenever required.'

def __init__(self, filename, file=None, contents=None, size=None):

    self._filename = filename
    if (file is None):
        self._file = GitFile(filename, 'rb')
    else:
        self._file = file
    if (contents is None):
        (self._contents, self._size) = _load_file_contents(self._file, size)
    else:
        (self._contents, self._size) = (contents, size)
