MCPcopy Create free account
hub / github.com/git/git / resolve_relative_path

Function resolve_relative_path

object-name.c:1702–1714  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1700
1701
1702static char *resolve_relative_path(struct repository *r, const char *rel)
1703{
1704 if (!starts_with(rel, "./") && !starts_with(rel, "../"))
1705 return NULL;
1706
1707 if (r != the_repository || !is_inside_work_tree(the_repository))
1708 die(_("relative path syntax can't be used outside working tree"));
1709
1710 /* die() inside prefix_path() if resolved path is outside worktree */
1711 return prefix_path(the_repository, startup_info->prefix,
1712 startup_info->prefix ? strlen(startup_info->prefix) : 0,
1713 rel);
1714}
1715
1716static int reject_tree_in_index(struct repository *repo,
1717 int only_to_die,

Callers 1

get_oid_with_context_1Function · 0.85

Calls 4

starts_withFunction · 0.85
is_inside_work_treeFunction · 0.85
prefix_pathFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected