| 442 | } |
| 443 | |
| 444 | static int path_exists(struct archiver_args *args, const char *path) |
| 445 | { |
| 446 | const char *paths[] = { path, NULL }; |
| 447 | struct path_exists_context ctx; |
| 448 | int ret; |
| 449 | |
| 450 | ctx.args = args; |
| 451 | parse_pathspec(&ctx.pathspec, 0, PATHSPEC_PREFER_CWD, |
| 452 | args->prefix, paths); |
| 453 | ctx.pathspec.recursive = 1; |
| 454 | if (args->prefix && read_tree(args->repo, args->tree, &ctx.pathspec, |
| 455 | reject_outside, args)) |
| 456 | die(_("pathspec '%s' matches files outside the " |
| 457 | "current directory"), path); |
| 458 | ret = read_tree(args->repo, args->tree, |
| 459 | &ctx.pathspec, |
| 460 | reject_entry, &ctx); |
| 461 | clear_pathspec(&ctx.pathspec); |
| 462 | return ret != 0; |
| 463 | } |
| 464 | |
| 465 | static void parse_pathspec_arg(const char **pathspec, |
| 466 | struct archiver_args *ar_args) |
no test coverage detected