| 155 | } |
| 156 | |
| 157 | static int add_one_reference(struct string_list_item *item, void *cb_data) |
| 158 | { |
| 159 | struct strbuf err = STRBUF_INIT; |
| 160 | int *required = cb_data; |
| 161 | char *ref_git = compute_alternate_path(item->string, &err); |
| 162 | |
| 163 | if (!ref_git) { |
| 164 | if (*required) |
| 165 | die("%s", err.buf); |
| 166 | else |
| 167 | fprintf(stderr, |
| 168 | _("info: Could not add alternate for '%s': %s\n"), |
| 169 | item->string, err.buf); |
| 170 | } else { |
| 171 | struct strbuf sb = STRBUF_INIT; |
| 172 | strbuf_addf(&sb, "%s/objects", ref_git); |
| 173 | odb_add_to_alternates_file(the_repository->objects, sb.buf); |
| 174 | strbuf_release(&sb); |
| 175 | } |
| 176 | |
| 177 | strbuf_release(&err); |
| 178 | free(ref_git); |
| 179 | return 0; |
| 180 | } |
| 181 | |
| 182 | static void setup_reference(void) |
| 183 | { |
nothing calls this directly
no test coverage detected