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

Function reparent_relative_path

chdir-notify.c:100–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98}
99
100char *reparent_relative_path(const char *old_cwd,
101 const char *new_cwd,
102 const char *path)
103{
104 char *ret, *full;
105
106 if (is_absolute_path(path))
107 return xstrdup(path);
108
109 full = xstrfmt("%s/%s", old_cwd, path);
110 ret = xstrdup(remove_leading_path(full, new_cwd));
111 free(full);
112
113 return ret;
114}

Callers 5

update_relative_gitdirFunction · 0.85
tmp_objdir_reparentFunction · 0.85
reparent_cbFunction · 0.85

Calls 4

is_absolute_pathFunction · 0.85
xstrdupFunction · 0.85
xstrfmtFunction · 0.85
remove_leading_pathFunction · 0.85

Tested by

no test coverage detected