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

Function log_ref_write_fd

refs/files-backend.c:1933–1953  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1931}
1932
1933static int log_ref_write_fd(int fd, const struct object_id *old_oid,
1934 const struct object_id *new_oid,
1935 const char *committer, const char *msg)
1936{
1937 struct strbuf sb = STRBUF_INIT;
1938 int ret = 0;
1939
1940 if (!committer)
1941 committer = git_committer_info(0);
1942
1943 strbuf_addf(&sb, "%s %s %s", oid_to_hex(old_oid), oid_to_hex(new_oid), committer);
1944 if (msg && *msg) {
1945 strbuf_addch(&sb, '\t');
1946 strbuf_addstr(&sb, msg);
1947 }
1948 strbuf_addch(&sb, '\n');
1949 if (write_in_full(fd, sb.buf, sb.len) < 0)
1950 ret = -1;
1951 strbuf_release(&sb);
1952 return ret;
1953}
1954
1955static int files_log_ref_write(struct files_ref_store *refs,
1956 const char *refname,

Callers 1

files_log_ref_writeFunction · 0.85

Calls 7

git_committer_infoFunction · 0.85
strbuf_addfFunction · 0.85
oid_to_hexFunction · 0.85
strbuf_addchFunction · 0.85
strbuf_addstrFunction · 0.85
write_in_fullFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by

no test coverage detected