diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-10-03 13:30:38 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-10-03 13:30:38 -0700 |
commit | 4e34e20c9fd25a91dad0003547b43cfa00b2740c (patch) | |
tree | b29a6aa0732ac177ec905e60d2171fad6f397dd0 /tree-walk.h | |
parent | Merge branch 'kd/mailinfo-quoted-string' (diff) | |
parent | fsck: handle bad trees like other errors (diff) | |
download | tgif-4e34e20c9fd25a91dad0003547b43cfa00b2740c.tar.xz |
Merge branch 'dt/tree-fsck'
The codepath in "git fsck" to detect malformed tree objects has
been updated not to die but keep going after detecting them.
* dt/tree-fsck:
fsck: handle bad trees like other errors
tree-walk: be more specific about corrupt tree errors
Diffstat (limited to 'tree-walk.h')
-rw-r--r-- | tree-walk.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tree-walk.h b/tree-walk.h index 97a7d6957e..68bb78b928 100644 --- a/tree-walk.h +++ b/tree-walk.h @@ -25,14 +25,22 @@ static inline int tree_entry_len(const struct name_entry *ne) return (const char *)ne->oid - ne->path - 1; } +/* + * The _gently versions of these functions warn and return false on a + * corrupt tree entry rather than dying, + */ + void update_tree_entry(struct tree_desc *); +int update_tree_entry_gently(struct tree_desc *); void init_tree_desc(struct tree_desc *desc, const void *buf, unsigned long size); +int init_tree_desc_gently(struct tree_desc *desc, const void *buf, unsigned long size); /* * Helper function that does both tree_entry_extract() and update_tree_entry() * and returns true for success */ int tree_entry(struct tree_desc *, struct name_entry *); +int tree_entry_gently(struct tree_desc *, struct name_entry *); void *fill_tree_descriptor(struct tree_desc *desc, const unsigned char *sha1); |