| 2881 | } |
| 2882 | |
| 2883 | void 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 ':'. |
no test coverage detected