diff options
-rw-r--r-- | builtin/repack.c | 6 | ||||
-rwxr-xr-x | t/t5537-fetch-shallow.sh | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/builtin/repack.c b/builtin/repack.c index d5886039cc..3c30e16ec5 100644 --- a/builtin/repack.c +++ b/builtin/repack.c @@ -531,6 +531,12 @@ int cmd_repack(int argc, const char **argv, const char *prefix) if (!po_args.quiet && isatty(2)) opts |= PRUNE_PACKED_VERBOSE; prune_packed_objects(opts); + + if (!keep_unreachable && + (!(pack_everything & LOOSEN_UNREACHABLE) || + unpack_unreachable) && + is_repository_shallow(the_repository)) + prune_shallow(PRUNE_QUICK); } if (!no_update_server_info) diff --git a/t/t5537-fetch-shallow.sh b/t/t5537-fetch-shallow.sh index 686fdc9280..6faf17e17a 100755 --- a/t/t5537-fetch-shallow.sh +++ b/t/t5537-fetch-shallow.sh @@ -186,7 +186,7 @@ EOF test_cmp expect actual ' -test_expect_failure '.git/shallow is edited by repack' ' +test_expect_success '.git/shallow is edited by repack' ' git init shallow-server && test_commit -C shallow-server A && test_commit -C shallow-server B && |