diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-12-02 23:00:04 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-12-02 23:00:04 -0800 |
commit | 0fd9d7e66deb7071da2a568b96c94f94ee890908 (patch) | |
tree | e8af2cdc7eee0aaa92087e7e798aa8d1c0d6acf1 /builtin-pack-objects.c | |
parent | e23f6822df5ee0acfe244c819a419c3e7c8c9e7e (diff) | |
parent | 83d0289df6fb4deae100ee3fc37b90683c2e8c9f (diff) | |
download | git-0fd9d7e66deb7071da2a568b96c94f94ee890908.tar.gz |
Merge branch 'bc/maint-keep-pack' into maint
* bc/maint-keep-pack:
repack: only unpack-unreachable if we are deleting redundant packs
t7700: test that 'repack -a' packs alternate packed objects
pack-objects: extend --local to mean ignore non-local loose objects too
sha1_file.c: split has_loose_object() into local and non-local counterparts
t7700: demonstrate mishandling of loose objects in an alternate ODB
builtin-gc.c: use new pack_keep bitfield to detect .keep file existence
repack: do not fall back to incremental repacking with [-a|-A]
repack: don't repack local objects in packs with .keep file
pack-objects: new option --honor-pack-keep
packed_git: convert pack_local flag into a bitfield and add pack_keep
t7700: demonstrate mishandling of objects in packs with a .keep file
Diffstat (limited to 'builtin-pack-objects.c')
-rw-r--r-- | builtin-pack-objects.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c index 8fe51244e0..4411a480c1 100644 --- a/builtin-pack-objects.c +++ b/builtin-pack-objects.c @@ -71,6 +71,7 @@ static int reuse_delta = 1, reuse_object = 1; static int keep_unreachable, unpack_unreachable, include_tag; static int local; static int incremental; +static int ignore_packed_keep; static int allow_ofs_delta; static const char *base_name; static int progress = 1; @@ -698,6 +699,9 @@ static int add_object_entry(const unsigned char *sha1, enum object_type type, return 0; } + if (!exclude && local && has_loose_object_nonlocal(sha1)) + return 0; + for (p = packed_git; p; p = p->next) { off_t offset = find_pack_entry_one(sha1, p); if (offset) { @@ -711,6 +715,8 @@ static int add_object_entry(const unsigned char *sha1, enum object_type type, return 0; if (local && !p->pack_local) return 0; + if (ignore_packed_keep && p->pack_local && p->pack_keep) + return 0; } } @@ -2050,6 +2056,10 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix) incremental = 1; continue; } + if (!strcmp("--honor-pack-keep", arg)) { + ignore_packed_keep = 1; + continue; + } if (!prefixcmp(arg, "--compression=")) { char *end; int level = strtoul(arg+14, &end, 0); |