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

Function sequencer_determine_whence

sequencer.c:6847–6866  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6845}
6846
6847int sequencer_determine_whence(struct repository *r, enum commit_whence *whence)
6848{
6849 if (refs_ref_exists(get_main_ref_store(r), "CHERRY_PICK_HEAD")) {
6850 struct object_id cherry_pick_head, rebase_head;
6851
6852 if (file_exists(git_path_seq_dir()))
6853 *whence = FROM_CHERRY_PICK_MULTI;
6854 if (file_exists(rebase_path()) &&
6855 !repo_get_oid(r, "REBASE_HEAD", &rebase_head) &&
6856 !repo_get_oid(r, "CHERRY_PICK_HEAD", &cherry_pick_head) &&
6857 oideq(&rebase_head, &cherry_pick_head))
6858 *whence = FROM_REBASE_PICK;
6859 else
6860 *whence = FROM_CHERRY_PICK_SINGLE;
6861
6862 return 1;
6863 }
6864
6865 return 0;
6866}
6867
6868int sequencer_get_update_refs_state(const char *wt_dir,
6869 struct string_list *refs)

Callers 1

determine_whenceFunction · 0.85

Calls 5

refs_ref_existsFunction · 0.85
get_main_ref_storeFunction · 0.85
file_existsFunction · 0.85
repo_get_oidFunction · 0.85
oideqFunction · 0.85

Tested by

no test coverage detected