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

Function get_stat_data

diff-lib.c:315–349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

313}
314
315static int get_stat_data(const struct cache_entry *ce,
316 const struct object_id **oidp,
317 unsigned int *modep,
318 int cached, int match_missing,
319 unsigned *dirty_submodule, struct diff_options *diffopt)
320{
321 const struct object_id *oid = &ce->oid;
322 unsigned int mode = ce->ce_mode;
323
324 if (!cached && !ce_uptodate(ce)) {
325 int changed;
326 struct stat st;
327 changed = check_removed(ce, &st);
328 if (changed < 0)
329 return -1;
330 else if (changed) {
331 if (match_missing) {
332 *oidp = oid;
333 *modep = mode;
334 return 0;
335 }
336 return -1;
337 }
338 changed = match_stat_with_submodule(diffopt, ce, &st,
339 0, dirty_submodule);
340 if (changed) {
341 mode = ce_mode_from_stat(ce, st.st_mode);
342 oid = null_oid(the_hash_algo);
343 }
344 }
345
346 *oidp = oid;
347 *modep = mode;
348 return 0;
349}
350
351static void show_new_file(struct rev_info *revs,
352 const struct cache_entry *new_file,

Callers 2

show_new_fileFunction · 0.85
show_modifiedFunction · 0.85

Calls 4

check_removedFunction · 0.85
ce_mode_from_statFunction · 0.85
null_oidFunction · 0.85

Tested by

no test coverage detected