| 1700 | |
| 1701 | |
| 1702 | static char *resolve_relative_path(struct repository *r, const char *rel) |
| 1703 | { |
| 1704 | if (!starts_with(rel, "./") && !starts_with(rel, "../")) |
| 1705 | return NULL; |
| 1706 | |
| 1707 | if (r != the_repository || !is_inside_work_tree(the_repository)) |
| 1708 | die(_("relative path syntax can't be used outside working tree")); |
| 1709 | |
| 1710 | /* die() inside prefix_path() if resolved path is outside worktree */ |
| 1711 | return prefix_path(the_repository, startup_info->prefix, |
| 1712 | startup_info->prefix ? strlen(startup_info->prefix) : 0, |
| 1713 | rel); |
| 1714 | } |
| 1715 | |
| 1716 | static int reject_tree_in_index(struct repository *repo, |
| 1717 | int only_to_die, |
no test coverage detected