summaryrefslogtreecommitdiff
path: root/builtin-pack-objects.c
diff options
context:
space:
mode:
authorBrandon Casey <casey@nrlssc.navy.mil>2009-03-19 22:47:52 -0500
committerJunio C Hamano <gitster@pobox.com>2009-03-20 13:32:33 -0700
commit79bc4c715516fdb393d107359327c1e7fbb8bf04 (patch)
tree04fa7c94626afb25a5fd433845404fb4695af047 /builtin-pack-objects.c
parent171110a4a67f04c28d2ac89385ab88ba051fc780 (diff)
downloadgit-79bc4c715516fdb393d107359327c1e7fbb8bf04.tar.gz
pack-objects: only repack or loosen objects residing in "local" packs
These two features were invented for use by repack when repack will delete the local packs that have been made redundant. The packs accessible through alternates are not deleted by repack, so the objects contained in them are still accessible after the local packs are deleted. They do not need to be repacked into the new pack or loosened. For the case of loosening they would immediately be deleted by the subsequent prune-packed that is called by repack anyway. This fixes the test 'packed unreachable obs in alternate ODB are not loosened' in t7700. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-pack-objects.c')
-rw-r--r--builtin-pack-objects.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index b2e46264ee..aae4d243b3 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -1915,7 +1915,7 @@ static void add_objects_in_unpacked_packs(struct rev_info *revs)
const unsigned char *sha1;
struct object *o;
- if (p->pack_keep)
+ if (!p->pack_local || p->pack_keep)
continue;
if (open_pack_index(p))
die("cannot open pack index");
@@ -1951,7 +1951,7 @@ static void loosen_unused_packed_objects(struct rev_info *revs)
const unsigned char *sha1;
for (p = packed_git; p; p = p->next) {
- if (p->pack_keep)
+ if (!p->pack_local || p->pack_keep)
continue;
if (open_pack_index(p))