MCPcopy Create free account
hub / github.com/git/git / get_locked_file_path

Function get_locked_file_path

lockfile.c:325–336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

323}
324
325char *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
338int commit_lock_file(struct lock_file *lk)
339{

Callers 5

commit_lock_fileFunction · 0.85
write_with_updatesFunction · 0.85
commit_refFunction · 0.85
create_ref_symlinkFunction · 0.85

Calls 4

strbuf_addstrFunction · 0.85
get_tempfile_pathFunction · 0.85
strbuf_setlenFunction · 0.85
strbuf_detachFunction · 0.85

Tested by

no test coverage detected