MCPcopy Index your code
hub / github.com/git/git / adjust_git_path

Function adjust_git_path

path.c:387–404  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

385}
386
387static 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
406static void strbuf_worktree_gitdir(struct strbuf *buf,
407 const struct repository *repo,

Callers 1

repo_git_pathvFunction · 0.85

Calls 6

is_dir_fileFunction · 0.85
strbuf_spliceFunction · 0.85
dir_prefixFunction · 0.85
replace_dirFunction · 0.85
update_common_dirFunction · 0.85

Tested by

no test coverage detected