the result should be freed by the caller. */
| 153 | |
| 154 | /* the result should be freed by the caller. */ |
| 155 | static char *get_submodule_displaypath(const char *path, const char *prefix, |
| 156 | const char *super_prefix) |
| 157 | { |
| 158 | if (prefix && super_prefix) { |
| 159 | BUG("cannot have prefix '%s' and superprefix '%s'", |
| 160 | prefix, super_prefix); |
| 161 | } else if (prefix) { |
| 162 | struct strbuf sb = STRBUF_INIT; |
| 163 | char *displaypath = xstrdup(relative_path(path, prefix, &sb)); |
| 164 | strbuf_release(&sb); |
| 165 | return displaypath; |
| 166 | } else if (super_prefix) { |
| 167 | return xstrfmt("%s%s", super_prefix, path); |
| 168 | } else { |
| 169 | return xstrdup(path); |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | static char *compute_rev_name(const char *sub_path, const char* object_id) |
| 174 | { |
no test coverage detected