MCPcopy Index your code
hub / github.com/git/git / strbuf_read_file

Function strbuf_read_file

strbuf.c:778–796  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

776}
777
778ssize_t strbuf_read_file(struct strbuf *sb, const char *path, size_t hint)
779{
780 int fd;
781 ssize_t len;
782 int saved_errno;
783
784 fd = open(path, O_RDONLY);
785 if (fd < 0)
786 return -1;
787 len = strbuf_read(sb, fd, hint);
788 saved_errno = errno;
789 close(fd);
790 if (len < 0) {
791 errno = saved_errno;
792 return -1;
793 }
794
795 return len;
796}
797
798void strbuf_add_lines(struct strbuf *out, const char *prefix,
799 const char *buf, size_t size)

Callers 15

get_common_dir_noenvFunction · 0.85
fake_working_tree_commitFunction · 0.85
write_archive_entriesFunction · 0.85
prepare_orderFunction · 0.85
get_linked_worktreeFunction · 0.85
worktree_lock_reasonFunction · 0.85
infer_backlinkFunction · 0.85
repair_worktree_at_pathFunction · 0.85
sequencer_remove_stateFunction · 0.85
read_onelinerFunction · 0.85

Calls 1

strbuf_readFunction · 0.85

Tested by 1

cmd__deltaFunction · 0.68