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

Function replace_dir

path.c:77–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77static void replace_dir(struct strbuf *buf, int len, const char *newdir)
78{
79 int newlen = strlen(newdir);
80 int need_sep = (buf->buf[len] && !is_dir_sep(buf->buf[len])) &&
81 !is_dir_sep(newdir[newlen - 1]);
82 if (need_sep)
83 len--; /* keep one char, to be replaced with '/' */
84 strbuf_splice(buf, 0, len, newdir, newlen);
85 if (need_sep)
86 buf->buf[newlen] = '/';
87}
88
89struct common_dir {
90 /* Not considered garbage for report_linked_checkout_garbage */

Callers 2

update_common_dirFunction · 0.85
adjust_git_pathFunction · 0.85

Calls 1

strbuf_spliceFunction · 0.85

Tested by

no test coverage detected