| 174 | } |
| 175 | |
| 176 | static int list_refs(struct string_list *r, int argc, const char **argv) |
| 177 | { |
| 178 | int i; |
| 179 | |
| 180 | for (i = 0; i < r->nr; i++) { |
| 181 | struct object_id *oid; |
| 182 | const char *name; |
| 183 | |
| 184 | if (argc > 1) { |
| 185 | int j; |
| 186 | for (j = 1; j < argc; j++) |
| 187 | if (!strcmp(r->items[i].string, argv[j])) |
| 188 | break; |
| 189 | if (j == argc) |
| 190 | continue; |
| 191 | } |
| 192 | |
| 193 | oid = r->items[i].util; |
| 194 | name = r->items[i].string; |
| 195 | printf("%s %s\n", oid_to_hex(oid), name); |
| 196 | } |
| 197 | return 0; |
| 198 | } |
| 199 | |
| 200 | /* Remember to update object flag allocation in object.h */ |
| 201 | #define PREREQ_MARK (1u<<16) |
no test coverage detected