| 75 | } |
| 76 | |
| 77 | static 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 | |
| 89 | struct common_dir { |
| 90 | /* Not considered garbage for report_linked_checkout_garbage */ |
no test coverage detected