MCPcopy Create free account
hub / github.com/git/git / remote_state_clear

Function remote_state_clear

remote.c:2883–2905  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2881}
2882
2883void remote_state_clear(struct remote_state *remote_state)
2884{
2885 struct hashmap_iter iter;
2886 struct branch *b;
2887 int i;
2888
2889 for (i = 0; i < remote_state->remotes_nr; i++)
2890 remote_clear(remote_state->remotes[i]);
2891 FREE_AND_NULL(remote_state->remotes);
2892 FREE_AND_NULL(remote_state->pushremote_name);
2893 remote_state->remotes_alloc = 0;
2894 remote_state->remotes_nr = 0;
2895
2896 rewrites_release(&remote_state->rewrites);
2897 rewrites_release(&remote_state->rewrites_push);
2898
2899 hashmap_clear_and_free(&remote_state->remotes_hash, struct remote, ent);
2900 hashmap_for_each_entry(&remote_state->branches_hash, &iter, b, ent) {
2901 branch_release(b);
2902 free(b);
2903 }
2904 hashmap_clear(&remote_state->branches_hash);
2905}
2906
2907/*
2908 * Returns 1 if it was the last chop before ':'.

Callers 2

repo_clearFunction · 0.85
cmd_cloneFunction · 0.85

Calls 3

remote_clearFunction · 0.85
rewrites_releaseFunction · 0.85
branch_releaseFunction · 0.85

Tested by

no test coverage detected