diff --git a/builtin/repack.c b/builtin/repack.c index bcf280b10d..4ca2f647b4 100644 --- a/builtin/repack.c +++ b/builtin/repack.c @@ -351,7 +351,7 @@ static void split_pack_geometry(struct pack_geometry *geometry, int factor) uint32_t split; off_t total_size = 0; - if (geometry->pack_nr <= 1) { + if (!geometry->pack_nr) { geometry->split = geometry->pack_nr; return; } diff --git a/t/t7703-repack-geometric.sh b/t/t7703-repack-geometric.sh index 96917fc163..4a1952a054 100755 --- a/t/t7703-repack-geometric.sh +++ b/t/t7703-repack-geometric.sh @@ -20,6 +20,21 @@ test_expect_success '--geometric with no packs' ' ) ' +test_expect_success '--geometric with one pack' ' + git init geometric && + test_when_finished "rm -fr geometric" && + ( + cd geometric && + + test_commit "base" && + git repack -d && + + git repack --geometric 2 >out && + + test_i18ngrep "Nothing new to pack" out + ) +' + test_expect_success '--geometric with an intact progression' ' git init geometric && test_when_finished "rm -fr geometric" &&