| 430 | } |
| 431 | |
| 432 | void update_worktree_location(struct worktree *wt, const char *path_, |
| 433 | int use_relative_paths) |
| 434 | { |
| 435 | struct strbuf path = STRBUF_INIT; |
| 436 | struct strbuf dotgit = STRBUF_INIT; |
| 437 | struct strbuf gitdir = STRBUF_INIT; |
| 438 | char *wt_gitdir; |
| 439 | |
| 440 | if (is_main_worktree(wt)) |
| 441 | BUG("can't relocate main worktree"); |
| 442 | |
| 443 | wt_gitdir = repo_common_path(the_repository, "worktrees/%s/gitdir", wt->id); |
| 444 | strbuf_realpath(&gitdir, wt_gitdir, 1); |
| 445 | strbuf_realpath(&path, path_, 1); |
| 446 | strbuf_addf(&dotgit, "%s/.git", path.buf); |
| 447 | if (fspathcmp(wt->path, path.buf)) { |
| 448 | write_worktree_linking_files(dotgit.buf, gitdir.buf, use_relative_paths); |
| 449 | |
| 450 | free(wt->path); |
| 451 | wt->path = strbuf_detach(&path, NULL); |
| 452 | } |
| 453 | strbuf_release(&path); |
| 454 | strbuf_release(&dotgit); |
| 455 | strbuf_release(&gitdir); |
| 456 | free(wt_gitdir); |
| 457 | } |
| 458 | |
| 459 | int is_worktree_being_rebased(const struct worktree *wt, |
| 460 | const char *target) |
no test coverage detected