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

Function get_object_list

builtin/pack-objects.c:4815–4910  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4813}
4814
4815static void get_object_list(struct rev_info *revs, struct strvec *argv)
4816{
4817 struct setup_revision_opt s_r_opt = {
4818 .allow_exclude_promisor_objects = 1,
4819 };
4820 struct repo_config_values *cfg = repo_config_values(the_repository);
4821 char line[1000];
4822 int flags = 0;
4823 int save_warning;
4824
4825 save_commit_buffer = 0;
4826 setup_revisions_from_strvec(argv, revs, &s_r_opt);
4827
4828 /* make sure shallows are read */
4829 is_repository_shallow(the_repository);
4830
4831 save_warning = cfg->warn_on_object_refname_ambiguity;
4832 cfg->warn_on_object_refname_ambiguity = 0;
4833
4834 while (fgets(line, sizeof(line), stdin) != NULL) {
4835 int len = strlen(line);
4836 if (len && line[len - 1] == '\n')
4837 line[--len] = 0;
4838 if (!len)
4839 break;
4840 if (*line == '-') {
4841 if (!strcmp(line, "--not")) {
4842 flags ^= UNINTERESTING;
4843 write_bitmap_index = 0;
4844 continue;
4845 }
4846 if (starts_with(line, "--shallow ")) {
4847 struct object_id oid;
4848 if (get_oid_hex(line + 10, &oid))
4849 die("not an object name '%s'", line + 10);
4850 register_shallow(the_repository, &oid);
4851 use_bitmap_index = 0;
4852 continue;
4853 }
4854 die(_("not a rev '%s'"), line);
4855 }
4856 if (handle_revision_arg(line, revs, flags, REVARG_CANNOT_BE_FILENAME))
4857 die(_("bad revision '%s'"), line);
4858 }
4859
4860 cfg->warn_on_object_refname_ambiguity = save_warning;
4861
4862 if (use_bitmap_index && !get_object_list_from_bitmap(revs))
4863 return;
4864
4865 if (use_delta_islands)
4866 load_delta_islands(the_repository, progress);
4867
4868 if (write_bitmap_index)
4869 for_each_preferred_bitmap_tip(the_repository, mark_bitmap_preferred_tip,
4870 NULL);
4871
4872 if (!fn_show_object)

Callers 1

cmd_pack_objectsFunction · 0.85

Calls 15

is_repository_shallowFunction · 0.85
starts_withFunction · 0.85
get_oid_hexFunction · 0.85
register_shallowFunction · 0.85
handle_revision_argFunction · 0.85
load_delta_islandsFunction · 0.85
warningFunction · 0.85
prepare_revision_walkFunction · 0.85

Tested by

no test coverage detected