aboutsummaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorNicolas Pitre <nico@cam.org>2008-06-23 21:23:39 -0400
committerJunio C Hamano <gitster@pobox.com>2008-06-23 21:29:33 -0700
commit8eca0b47ff1598a6d163df9358c0e0c9bd92d4c8 (patch)
tree166dcf6574962399fab1879751fba11487cab218 /cache.h
parent1f5c74f6cf918d317c73b328dcd4cf6f55c44d8a (diff)
downloadgit-8eca0b47ff1598a6d163df9358c0e0c9bd92d4c8.tar.gz
git-8eca0b47ff1598a6d163df9358c0e0c9bd92d4c8.tar.xz
implement some resilience against pack corruptions
We should be able to fall back to loose objects or alternative packs when a pack becomes corrupted. This is especially true when an object exists in one pack only as a delta but its base object is corrupted. Currently there is no way to retrieve the former object even if the later is available in another pack or loose. This patch allows for a delta to be resolved (with a performance cost) using a base object from a source other than the pack where that delta is located. Same thing for non-delta objects: rather than failing outright, a search is made in other packs or used loose when the currently active pack has it but corrupted. Of course git will become extremely noisy with error messages when that happens. However, if the operation succeeds nevertheless, a simple 'git repack -a -f -d' will "fix" the corrupted repository given that all corrupted objects have a good duplicate somewhere in the object store, possibly manually copied from another source. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index d12ee7d0f..a68866c1b 100644
--- a/cache.h
+++ b/cache.h
@@ -641,6 +641,8 @@ extern struct packed_git {
const void *index_data;
size_t index_size;
uint32_t num_objects;
+ uint32_t num_bad_objects;
+ unsigned char *bad_object_sha1;
int index_version;
time_t mtime;
int pack_fd;