Skip to content

Commit 14e280b

Browse files
committed
Merge branch 'fix-fsmonitor-crash'
This topic branch fixes a really hard-to-trigger corner case bug that happened to me during one of those Git for Windows rebases. Signed-off-by: Johannes Schindelin <[email protected]>
2 parents 8aba188 + 2b4dd0c commit 14e280b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

read-cache.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2386,6 +2386,7 @@ int discard_index(struct index_state *istate)
23862386
cache_tree_free(&(istate->cache_tree));
23872387
istate->initialized = 0;
23882388
istate->fsmonitor_has_run_once = 0;
2389+
FREE_AND_NULL(istate->fsmonitor_last_update);
23892390
FREE_AND_NULL(istate->cache);
23902391
istate->cache_alloc = 0;
23912392
discard_split_index(istate);

unpack-trees.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,8 +1611,8 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
16111611
o->merge_size = len;
16121612
mark_all_ce_unused(o->src_index);
16131613

1614-
if (o->src_index->fsmonitor_last_update)
1615-
o->result.fsmonitor_last_update = o->src_index->fsmonitor_last_update;
1614+
o->result.fsmonitor_last_update =
1615+
xstrdup_or_null(o->src_index->fsmonitor_last_update);
16161616

16171617
/*
16181618
* Sparse checkout loop #1: set NEW_SKIP_WORKTREE on existing entries

0 commit comments

Comments
 (0)