]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'ps/cache-tree-w-broken-index-entry'
authorTaylor Blau <me@ttaylorr.com>
Tue, 22 Oct 2024 18:40:38 +0000 (14:40 -0400)
committerTaylor Blau <me@ttaylorr.com>
Tue, 22 Oct 2024 18:40:38 +0000 (14:40 -0400)
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

1  2 
cache-tree.c
read-cache.c

diff --cc cache-tree.c
index b482167a69ae6acaee05a500850a529e6ae425f9,1e62567308622c57bd057f547ac0e65a1eb74b3c..c595e8612044c7c909e87dbaf193416f3d6b1ca6
@@@ -1,6 -1,8 +1,7 @@@
  #define USE_THE_REPOSITORY_VARIABLE
  
  #include "git-compat-util.h"
 -#include "environment.h"
+ #include "gettext.h"
  #include "hex.h"
  #include "lockfile.h"
  #include "tree.h"
diff --cc read-cache.c
Simple merge