| 673 | } |
| 674 | |
| 675 | static void process_refs(struct repository *repo, struct snapshot *snap) |
| 676 | { |
| 677 | struct worktree **worktrees, **p; |
| 678 | |
| 679 | for (size_t i = 0; i < snap->nr; i++) { |
| 680 | struct reference ref = { |
| 681 | .name = snap->ref[i].refname, |
| 682 | .oid = &snap->ref[i].oid, |
| 683 | }; |
| 684 | fsck_handle_ref(&ref, repo); |
| 685 | } |
| 686 | |
| 687 | if (include_reflogs) { |
| 688 | worktrees = get_worktrees(); |
| 689 | for (p = worktrees; *p; p++) { |
| 690 | struct worktree *wt = *p; |
| 691 | |
| 692 | refs_for_each_reflog(get_worktree_ref_store(wt), |
| 693 | fsck_handle_reflog, wt); |
| 694 | } |
| 695 | free_worktrees(worktrees); |
| 696 | } |
| 697 | |
| 698 | /* |
| 699 | * Not having any default heads isn't really fatal, but |
| 700 | * it does mean that "--unreachable" no longer makes any |
| 701 | * sense (since in this case everything will obviously |
| 702 | * be unreachable by definition. |
| 703 | * |
| 704 | * Showing dangling objects is valid, though (as those |
| 705 | * dangling objects are likely lost heads). |
| 706 | * |
| 707 | * So we just print a warning about it, and clear the |
| 708 | * "show_unreachable" flag. |
| 709 | */ |
| 710 | if (!default_refs) { |
| 711 | fprintf_ln(stderr, _("notice: No default references")); |
| 712 | show_unreachable = 0; |
| 713 | } |
| 714 | } |
| 715 | |
| 716 | struct for_each_loose_cb { |
| 717 | struct repository *repo; |
no test coverage detected