Merge branch 'nd/split-index-null-base-fix'
Split-index fix. * nd/split-index-null-base-fix: read-cache.c: fix writing "link" index ext with null base oid
This commit is contained in:
@ -2900,7 +2900,8 @@ static int do_write_index(struct index_state *istate, struct tempfile *tempfile,
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!strip_extensions && istate->split_index) {
|
||||
if (!strip_extensions && istate->split_index &&
|
||||
!is_null_oid(&istate->split_index->base_oid)) {
|
||||
struct strbuf sb = STRBUF_INIT;
|
||||
|
||||
err = write_link_extension(&sb, istate) < 0 ||
|
||||
@ -3195,7 +3196,7 @@ int write_locked_index(struct index_state *istate, struct lock_file *lock,
|
||||
ret = write_split_index(istate, lock, flags);
|
||||
|
||||
/* Freshen the shared index only if the split-index was written */
|
||||
if (!ret && !new_shared_index) {
|
||||
if (!ret && !new_shared_index && !is_null_oid(&si->base_oid)) {
|
||||
const char *shared_index = git_path("sharedindex.%s",
|
||||
oid_to_hex(&si->base_oid));
|
||||
freshen_shared_index(shared_index, 1);
|
||||
|
||||
Reference in New Issue
Block a user