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

Function get_root_part

abspath.c:54–64  ·  view source on GitHub ↗

copies root part from remaining to resolved, canonicalizing it on the way */

Source from the content-addressed store, hash-verified

52
53/* copies root part from remaining to resolved, canonicalizing it on the way */
54static void get_root_part(struct strbuf *resolved, struct strbuf *remaining)
55{
56 int offset = offset_1st_component(remaining->buf);
57
58 strbuf_reset(resolved);
59 strbuf_add(resolved, remaining->buf, offset);
60#ifdef GIT_WINDOWS_NATIVE
61 convert_slashes(resolved->buf);
62#endif
63 strbuf_remove(remaining, 0, offset);
64}
65
66/* We allow "recursive" symbolic links. Only within reason, though. */
67#ifndef MAXSYMLINKS

Callers 1

strbuf_realpath_1Function · 0.85

Calls 3

strbuf_addFunction · 0.85
convert_slashesFunction · 0.85
strbuf_removeFunction · 0.85

Tested by

no test coverage detected