| 147 | } |
| 148 | |
| 149 | char *prefix_path(struct repository *repo, const char *prefix, int len, const char *path) |
| 150 | { |
| 151 | char *r = prefix_path_gently(repo, prefix, len, NULL, path); |
| 152 | if (!r) { |
| 153 | const char *hint_path = repo_get_work_tree(repo); |
| 154 | if (!hint_path) |
| 155 | hint_path = repo_get_git_dir(repo); |
| 156 | die(_("'%s' is outside repository at '%s'"), path, |
| 157 | absolute_path(hint_path)); |
| 158 | } |
| 159 | return r; |
| 160 | } |
| 161 | |
| 162 | int path_inside_repo(struct repository *repo, const char *prefix, const char *path) |
| 163 | { |