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

Function link

compat/mingw.c:2899–2911  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2897}
2898
2899int link(const char *oldpath, const char *newpath)
2900{
2901 wchar_t woldpath[MAX_PATH], wnewpath[MAX_PATH];
2902 if (xutftowcs_path(woldpath, oldpath) < 0 ||
2903 xutftowcs_path(wnewpath, newpath) < 0)
2904 return -1;
2905
2906 if (!CreateHardLinkW(wnewpath, woldpath, NULL)) {
2907 errno = err_win_to_posix(GetLastError());
2908 return -1;
2909 }
2910 return 0;
2911}
2912
2913int symlink(const char *target, const char *link)
2914{

Callers 3

link_midx_to_chainFunction · 0.85
copy_or_link_directoryFunction · 0.85

Calls 2

xutftowcs_pathFunction · 0.85
err_win_to_posixFunction · 0.85

Tested by

no test coverage detected