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

Function strbuf_normalize_path

path.c:1211–1229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1209}
1210
1211int strbuf_normalize_path(struct strbuf *src)
1212{
1213 struct strbuf dst = STRBUF_INIT;
1214
1215 strbuf_grow(&dst, src->len);
1216 if (normalize_path_copy(dst.buf, src->buf) < 0) {
1217 strbuf_release(&dst);
1218 return -1;
1219 }
1220
1221 /*
1222 * normalize_path does not tell us the new length, so we have to
1223 * compute it by looking for the new NUL it placed
1224 */
1225 strbuf_setlen(&dst, strlen(dst.buf));
1226 strbuf_swap(src, &dst);
1227 strbuf_release(&dst);
1228 return 0;
1229}
1230
1231/*
1232 * path = Canonical absolute path

Callers 5

exec-cmd.cFile · 0.85
normalize_path_in_utf8Function · 0.85
files_fsck_refs_contentFunction · 0.85
strbuf_to_cone_patternFunction · 0.85

Calls 5

strbuf_growFunction · 0.85
normalize_path_copyFunction · 0.85
strbuf_releaseFunction · 0.85
strbuf_setlenFunction · 0.85
strbuf_swapFunction · 0.85

Tested by

no test coverage detected