* Collect the paths of submodules in 'changed' which have changed based on * the revisions as specified in 'argv'. Each entry in 'changed' will also * have a corresponding 'struct oid_array' (in the 'util' field) which lists * what the submodule pointers were updated to during the change. */
| 889 | * what the submodule pointers were updated to during the change. |
| 890 | */ |
| 891 | static void collect_changed_submodules(struct repository *r, |
| 892 | struct string_list *changed, |
| 893 | struct strvec *argv) |
| 894 | { |
| 895 | struct rev_info rev; |
| 896 | const struct commit *commit; |
| 897 | int save_warning; |
| 898 | struct setup_revision_opt s_r_opt = { |
| 899 | .assume_dashdash = 1, |
| 900 | }; |
| 901 | struct repo_config_values *cfg = repo_config_values(the_repository); |
| 902 | |
| 903 | save_warning = cfg->warn_on_object_refname_ambiguity; |
| 904 | cfg->warn_on_object_refname_ambiguity = 0; |
| 905 | repo_init_revisions(r, &rev, NULL); |
| 906 | setup_revisions_from_strvec(argv, &rev, &s_r_opt); |
| 907 | cfg->warn_on_object_refname_ambiguity = save_warning; |
| 908 | if (prepare_revision_walk(&rev)) |
| 909 | die(_("revision walk setup failed")); |
| 910 | |
| 911 | while ((commit = get_revision(&rev))) { |
| 912 | struct rev_info diff_rev; |
| 913 | struct collect_changed_submodules_cb_data data; |
| 914 | data.repo = r; |
| 915 | data.changed = changed; |
| 916 | data.commit_oid = &commit->object.oid; |
| 917 | |
| 918 | repo_init_revisions(r, &diff_rev, NULL); |
| 919 | diff_rev.diffopt.output_format |= DIFF_FORMAT_CALLBACK; |
| 920 | diff_rev.diffopt.format_callback = collect_changed_submodules_cb; |
| 921 | diff_rev.diffopt.format_callback_data = &data; |
| 922 | diff_rev.dense_combined_merges = 1; |
| 923 | diff_tree_combined_merge(commit, &diff_rev); |
| 924 | release_revisions(&diff_rev); |
| 925 | } |
| 926 | |
| 927 | reset_revision_walk(); |
| 928 | release_revisions(&rev); |
| 929 | } |
| 930 | |
| 931 | static void free_submodules_data(struct string_list *submodules) |
| 932 | { |
no test coverage detected