'Add an alternate path to this object store.'

def add_alternate_path(self, path):

    try:
        os.mkdir(os.path.join(self.path, INFODIR))
    except OSError as e:
        if (e.errno != errno.EEXIST):
            raise
    alternates_path = os.path.join(self.path, INFODIR, 'alternates')
    with GitFile(alternates_path, 'wb') as f:
        try:
            orig_f = open(alternates_path, 'rb')
        except (OSError, IOError) as e:
            if (e.errno != errno.ENOENT):
                raise
        else:
            with orig_f:
                f.write(orig_f.read())
        f.write((path.encode(sys.getfilesystemencoding()) + '\n'))
    if (not os.path.isabs(path)):
        path = os.path.join(self.path, path)
    self.alternates.append(DiskObjectStore(path))
