packfile: allow reprepare_packed_git to handle arbitrary repositories