diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-03-07 09:59:56 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-03-07 09:59:56 +0900 |
commit | 0efa3d74e705ed2c66c33854ac4bfd0d6c7f56de (patch) | |
tree | ef2634edad53b83fd6aea32a325da6a03d821149 /read-cache.c | |
parent | Merge branch 'rj/prune-packed-excess-args' (diff) | |
parent | read-cache.c: fix writing "link" index ext with null base oid (diff) | |
download | tgif-0efa3d74e705ed2c66c33854ac4bfd0d6c7f56de.tar.xz |
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
Diffstat (limited to 'read-cache.c')
-rw-r--r-- | read-cache.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/read-cache.c b/read-cache.c index 75ff234fc8..441537032f 100644 --- a/read-cache.c +++ b/read-cache.c @@ -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); |