| 323 | } |
| 324 | |
| 325 | char *get_locked_file_path(struct lock_file *lk) |
| 326 | { |
| 327 | struct strbuf ret = STRBUF_INIT; |
| 328 | |
| 329 | strbuf_addstr(&ret, get_tempfile_path(lk->tempfile)); |
| 330 | if (ret.len <= LOCK_SUFFIX_LEN || |
| 331 | strcmp(ret.buf + ret.len - LOCK_SUFFIX_LEN, LOCK_SUFFIX)) |
| 332 | BUG("get_locked_file_path() called for malformed lock object"); |
| 333 | /* remove ".lock": */ |
| 334 | strbuf_setlen(&ret, ret.len - LOCK_SUFFIX_LEN); |
| 335 | return strbuf_detach(&ret, NULL); |
| 336 | } |
| 337 | |
| 338 | int commit_lock_file(struct lock_file *lk) |
| 339 | { |
no test coverage detected