mirror of
https://github.com/git/git.git
synced 2026-01-09 01:34:00 +00:00
Merge branch 'ps/cache-tree-w-broken-index-entry'
Fail gracefully instead of crashing when attempting to write the contents of a corrupt in-core index as a tree object. * ps/cache-tree-w-broken-index-entry: unpack-trees: detect mismatching number of cache-tree/index entries cache-tree: detect mismatching number of index entries cache-tree: refactor verification to return error codes
This commit is contained in:
@@ -3335,8 +3335,9 @@ int write_locked_index(struct index_state *istate, struct lock_file *lock,
|
||||
int new_shared_index, ret, test_split_index_env;
|
||||
struct split_index *si = istate->split_index;
|
||||
|
||||
if (git_env_bool("GIT_TEST_CHECK_CACHE_TREE", 0))
|
||||
cache_tree_verify(the_repository, istate);
|
||||
if (git_env_bool("GIT_TEST_CHECK_CACHE_TREE", 0) &&
|
||||
cache_tree_verify(the_repository, istate) < 0)
|
||||
return -1;
|
||||
|
||||
if ((flags & SKIP_IF_UNCHANGED) && !istate->cache_changed) {
|
||||
if (flags & COMMIT_LOCK)
|
||||
|
||||
Reference in New Issue
Block a user