'Add a .keep file for the pack, preventing git from garbage collecting it.
:param msg: A message written inside the .keep file; can be used later
to determine whether or not a .keep file is obsolete.
:return: The path of the .keep file, as a string.'

def keep(self, msg=None):

    keepfile_name = ('%s.keep' % self._basename)
    with GitFile(keepfile_name, 'wb') as keepfile:
        if msg:
            keepfile.write(msg)
            keepfile.write('\n')
    return keepfile_name
