| 385 | } |
| 386 | |
| 387 | static void adjust_git_path(struct repository *repo, |
| 388 | struct strbuf *buf, int git_dir_len) |
| 389 | { |
| 390 | const char *base = buf->buf + git_dir_len; |
| 391 | |
| 392 | if (is_dir_file(base, "info", "grafts")) |
| 393 | strbuf_splice(buf, 0, buf->len, |
| 394 | repo->graft_file, strlen(repo->graft_file)); |
| 395 | else if (!strcmp(base, "index")) |
| 396 | strbuf_splice(buf, 0, buf->len, |
| 397 | repo->index_file, strlen(repo->index_file)); |
| 398 | else if (dir_prefix(base, "objects")) |
| 399 | replace_dir(buf, git_dir_len + 7, repo->objects->sources->path); |
| 400 | else if (repo_settings_get_hooks_path(repo) && dir_prefix(base, "hooks")) |
| 401 | replace_dir(buf, git_dir_len + 5, repo_settings_get_hooks_path(repo)); |
| 402 | else if (repo->different_commondir) |
| 403 | update_common_dir(buf, git_dir_len, repo->commondir); |
| 404 | } |
| 405 | |
| 406 | static void strbuf_worktree_gitdir(struct strbuf *buf, |
| 407 | const struct repository *repo, |
no test coverage detected