MCPcopy Index your code
hub / github.com/git/git / do_write_locked_index

Function do_write_locked_index

read-cache.c:3121–3159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3119}
3120
3121static int do_write_locked_index(struct index_state *istate,
3122 struct lock_file *lock,
3123 unsigned flags,
3124 enum write_extensions write_extensions)
3125{
3126 int ret;
3127 int was_full = istate->sparse_index == INDEX_EXPANDED;
3128
3129 ret = convert_to_sparse(istate, 0);
3130
3131 if (ret) {
3132 warning(_("failed to convert to a sparse-index"));
3133 return ret;
3134 }
3135
3136 trace2_region_enter_printf("index", "do_write_index", istate->repo,
3137 "%s", get_lock_file_path(lock));
3138 ret = do_write_index(istate, lock->tempfile, write_extensions, flags);
3139 trace2_region_leave_printf("index", "do_write_index", istate->repo,
3140 "%s", get_lock_file_path(lock));
3141
3142 if (was_full)
3143 ensure_full_index(istate);
3144
3145 if (ret)
3146 return ret;
3147 if (flags & COMMIT_LOCK)
3148 ret = commit_locked_index(lock);
3149 else
3150 ret = close_lock_file_gently(lock);
3151
3152 run_hooks_l(the_repository, "post-index-change",
3153 istate->updated_workdir ? "1" : "0",
3154 istate->updated_skipworktree ? "1" : "0", NULL);
3155 istate->updated_workdir = 0;
3156 istate->updated_skipworktree = 0;
3157
3158 return ret;
3159}
3160
3161static int write_split_index(struct index_state *istate,
3162 struct lock_file *lock,

Callers 2

write_split_indexFunction · 0.85
write_locked_indexFunction · 0.85

Calls 8

convert_to_sparseFunction · 0.85
warningFunction · 0.85
get_lock_file_pathFunction · 0.85
do_write_indexFunction · 0.85
ensure_full_indexFunction · 0.85
commit_locked_indexFunction · 0.85
close_lock_file_gentlyFunction · 0.85
run_hooks_lFunction · 0.85

Tested by

no test coverage detected