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

Function hashfd_ext

csum-file.c:164–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162}
163
164struct hashfile *hashfd_ext(const struct git_hash_algo *algop,
165 int fd, const char *name,
166 const struct hashfd_options *opts)
167{
168 struct hashfile *f = xmalloc(sizeof(*f));
169 f->fd = fd;
170 f->check_fd = -1;
171 f->offset = 0;
172 f->total = 0;
173 f->tp = opts->progress;
174 f->name = name;
175 f->do_crc = 0;
176 f->skip_hash = 0;
177
178 f->algop = unsafe_hash_algo(algop);
179 f->algop->init_fn(&f->ctx);
180
181 f->buffer_len = opts->buffer_len ? opts->buffer_len : DEFAULT_IO_BUFFER_SIZE;
182 f->buffer = xmalloc(f->buffer_len);
183 f->check_buffer = NULL;
184
185 return f;
186}
187
188struct hashfile *hashfd(const struct git_hash_algo *algop,
189 int fd, const char *name)

Callers 2

hashfdFunction · 0.85
write_pack_fileFunction · 0.85

Calls 2

unsafe_hash_algoFunction · 0.85
xmallocFunction · 0.70

Tested by

no test coverage detected