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

Function wt_status_get_state

wt-status.c:1823–1862  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1821}
1822
1823void wt_status_get_state(struct repository *r,
1824 struct wt_status_state *state,
1825 int get_detached_from)
1826{
1827 struct stat st;
1828 struct object_id oid;
1829 enum replay_action action;
1830 struct worktree *wt = get_current_worktree(r);
1831
1832 if (!stat(git_path_merge_head(r), &st)) {
1833 wt_status_check_rebase(wt, state);
1834 state->merge_in_progress = 1;
1835 } else if (wt_status_check_rebase(wt, state)) {
1836 ; /* all set */
1837 } else if (refs_ref_exists(get_main_ref_store(r), "CHERRY_PICK_HEAD") &&
1838 !repo_get_oid(r, "CHERRY_PICK_HEAD", &oid)) {
1839 state->cherry_pick_in_progress = 1;
1840 oidcpy(&state->cherry_pick_head_oid, &oid);
1841 }
1842 wt_status_check_bisect(wt, state);
1843 if (refs_ref_exists(get_main_ref_store(r), "REVERT_HEAD") &&
1844 !repo_get_oid(r, "REVERT_HEAD", &oid)) {
1845 state->revert_in_progress = 1;
1846 oidcpy(&state->revert_head_oid, &oid);
1847 }
1848 if (!sequencer_get_last_command(r, &action)) {
1849 if (action == REPLAY_PICK && !state->cherry_pick_in_progress) {
1850 state->cherry_pick_in_progress = 1;
1851 oidcpy(&state->cherry_pick_head_oid, null_oid(r->hash_algo));
1852 } else if (action == REPLAY_REVERT && !state->revert_in_progress) {
1853 state->revert_in_progress = 1;
1854 oidcpy(&state->revert_head_oid, null_oid(r->hash_algo));
1855 }
1856 }
1857 if (get_detached_from)
1858 wt_status_get_detached_from(r, state);
1859 wt_status_check_sparse_checkout(r, state);
1860
1861 free_worktree(wt);
1862}
1863
1864static void wt_longstatus_print_state(struct wt_status *s)
1865{

Callers 4

get_head_descriptionFunction · 0.85
wt_status_collectFunction · 0.85

Calls 13

get_current_worktreeFunction · 0.85
wt_status_check_rebaseFunction · 0.85
refs_ref_existsFunction · 0.85
get_main_ref_storeFunction · 0.85
repo_get_oidFunction · 0.85
oidcpyFunction · 0.85
wt_status_check_bisectFunction · 0.85
null_oidFunction · 0.85
free_worktreeFunction · 0.85

Tested by

no test coverage detected