'Move a specific file containing a pack into the pack directory.
:note: The file should be on the same file system as the
packs directory.
:param path: Path to the pack file.'

def move_in_pack(self, path):

    with PackData(path) as p:
        entries = p.sorted_entries()
        basename = self._get_pack_basepath(entries)
        with GitFile((basename + '.idx'), 'wb') as f:
            write_pack_index_v2(f, entries, p.get_stored_checksum())
    os.rename(path, (basename + '.pack'))
    final_pack = Pack(basename)
    self._add_known_pack(basename, final_pack)
    return final_pack
