| 761 | } |
| 762 | |
| 763 | static int is_main_worktree_path(const char *path) |
| 764 | { |
| 765 | struct strbuf target = STRBUF_INIT; |
| 766 | struct strbuf maindir = STRBUF_INIT; |
| 767 | int cmp; |
| 768 | |
| 769 | strbuf_add_real_path(&target, path); |
| 770 | strbuf_strip_suffix(&target, "/.git"); |
| 771 | strbuf_add_real_path(&maindir, repo_get_common_dir(the_repository)); |
| 772 | strbuf_strip_suffix(&maindir, "/.git"); |
| 773 | cmp = fspathcmp(maindir.buf, target.buf); |
| 774 | |
| 775 | strbuf_release(&maindir); |
| 776 | strbuf_release(&target); |
| 777 | return !cmp; |
| 778 | } |
| 779 | |
| 780 | /* |
| 781 | * If both the main worktree and linked worktree have been moved, then the |
no test coverage detected