| 478 | } |
| 479 | |
| 480 | int is_inside_work_tree(struct repository *repo) |
| 481 | { |
| 482 | struct strbuf buf = STRBUF_INIT; |
| 483 | const char *worktree; |
| 484 | int ret; |
| 485 | |
| 486 | worktree = repo_get_work_tree(repo); |
| 487 | if (!worktree) |
| 488 | return 0; |
| 489 | |
| 490 | ret = is_inside_dir(strbuf_realpath(&buf, worktree, 1)); |
| 491 | |
| 492 | strbuf_release(&buf); |
| 493 | return ret; |
| 494 | } |
| 495 | |
| 496 | void setup_work_tree(struct repository *repo) |
| 497 | { |
no test coverage detected