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

Function write_out_one_result

apply.c:4691–4714  ·  view source on GitHub ↗

phase zero is to remove, phase one is to create */

Source from the content-addressed store, hash-verified

4689
4690/* phase zero is to remove, phase one is to create */
4691static int write_out_one_result(struct apply_state *state,
4692 struct patch *patch,
4693 int phase)
4694{
4695 if (patch->is_delete > 0) {
4696 if (phase == 0)
4697 return remove_file(state, patch, 1);
4698 return 0;
4699 }
4700 if (patch->is_new > 0 || patch->is_copy) {
4701 if (phase == 1)
4702 return create_file(state, patch);
4703 return 0;
4704 }
4705 /*
4706 * Rename or modification boils down to the same
4707 * thing: remove the old, write the new
4708 */
4709 if (phase == 0)
4710 return remove_file(state, patch, patch->is_rename);
4711 if (phase == 1)
4712 return create_file(state, patch);
4713 return 0;
4714}
4715
4716static int write_out_one_reject(struct apply_state *state, struct patch *patch)
4717{

Callers 1

write_out_resultsFunction · 0.85

Calls 2

remove_fileFunction · 0.85
create_fileFunction · 0.70

Tested by

no test coverage detected