Message ID | pull.1711.v2.git.1712554017808.gitgitgadget@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 93e2ae1c95e2685f51fb6320508bbde20fa7949f |
Headers | show |
Series | [v2] midx: disable replace objects | expand |
"blanet via GitGitGadget" <gitgitgadget@gmail.com> writes: > From: Xing Xin <xingxin.xx@bytedance.com> > ... > Helped-by: Taylor Blau <me@ttaylorr.com> > Signed-off-by: Xing Xin <xingxin.xx@bytedance.com> > --- I think this took the review in https://lore.kernel.org/git/ZhLfqU9VNUW+2mmV@nand.local/ into account and is in good shape? Thanks, both.
On Wed, Apr 17, 2024 at 12:34:27PM -0700, Junio C Hamano wrote: > "blanet via GitGitGadget" <gitgitgadget@gmail.com> writes: > > > From: Xing Xin <xingxin.xx@bytedance.com> > > ... > > Helped-by: Taylor Blau <me@ttaylorr.com> > > Signed-off-by: Xing Xin <xingxin.xx@bytedance.com> > > --- > > I think this took the review in > > https://lore.kernel.org/git/ZhLfqU9VNUW+2mmV@nand.local/ > > into account and is in good shape? Yes, sorry for not explicitly ack-ing, this version looks good to me. Thanks, Taylor
Taylor Blau <me@ttaylorr.com> writes: > On Wed, Apr 17, 2024 at 12:34:27PM -0700, Junio C Hamano wrote: >> "blanet via GitGitGadget" <gitgitgadget@gmail.com> writes: >> >> > From: Xing Xin <xingxin.xx@bytedance.com> >> > ... >> > Helped-by: Taylor Blau <me@ttaylorr.com> >> > Signed-off-by: Xing Xin <xingxin.xx@bytedance.com> >> > --- >> >> I think this took the review in >> >> https://lore.kernel.org/git/ZhLfqU9VNUW+2mmV@nand.local/ >> >> into account and is in good shape? > > Yes, sorry for not explicitly ack-ing, this version looks good to me. Thanks.
diff --git a/builtin/multi-pack-index.c b/builtin/multi-pack-index.c index a72aebecaa2..8360932d2e7 100644 --- a/builtin/multi-pack-index.c +++ b/builtin/multi-pack-index.c @@ -8,6 +8,7 @@ #include "strbuf.h" #include "trace2.h" #include "object-store-ll.h" +#include "replace-object.h" #define BUILTIN_MIDX_WRITE_USAGE \ N_("git multi-pack-index [<options>] write [--preferred-pack=<pack>]" \ @@ -273,6 +274,8 @@ int cmd_multi_pack_index(int argc, const char **argv, }; struct option *options = parse_options_concat(builtin_multi_pack_index_options, common_opts); + disable_replace_refs(); + git_config(git_default_config, NULL); if (the_repository && diff --git a/t/t5326-multi-pack-bitmaps.sh b/t/t5326-multi-pack-bitmaps.sh index 70d1b58709a..1fb3b0f9d7a 100755 --- a/t/t5326-multi-pack-bitmaps.sh +++ b/t/t5326-multi-pack-bitmaps.sh @@ -434,6 +434,27 @@ test_expect_success 'tagged commits are selected for bitmapping' ' ) ' +test_expect_success 'do not follow replace objects for MIDX bitmap' ' + rm -fr repo && + git init repo && + test_when_finished "rm -fr repo" && + ( + cd repo && + + test_commit A && + test_commit B && + git checkout --orphan=orphan A && + test_commit orphan && + + git replace A HEAD && + git repack -ad --write-midx --write-bitmap-index && + + # generating reachability bitmaps with replace refs + # enabled will result in broken clones + git clone --no-local --bare . clone.git + ) +' + corrupt_file () { chmod a+w "$1" && printf "bogus" | dd of="$1" bs=1 seek="12" conv=notrunc