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

Function diff_summary

diff.c:6803–6831  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6801}
6802
6803static void diff_summary(struct diff_options *opt, struct diff_filepair *p)
6804{
6805 switch(p->status) {
6806 case DIFF_STATUS_DELETED:
6807 show_file_mode_name(opt, "delete", p->one);
6808 break;
6809 case DIFF_STATUS_ADDED:
6810 show_file_mode_name(opt, "create", p->two);
6811 break;
6812 case DIFF_STATUS_COPIED:
6813 show_rename_copy(opt, "copy", p);
6814 break;
6815 case DIFF_STATUS_RENAMED:
6816 show_rename_copy(opt, "rename", p);
6817 break;
6818 default:
6819 if (p->score) {
6820 struct strbuf sb = STRBUF_INIT;
6821 strbuf_addstr(&sb, " rewrite ");
6822 quote_c_style(p->two->path, &sb, NULL, 0);
6823 strbuf_addf(&sb, " (%d%%)\n", similarity_index(p));
6824 emit_diff_symbol(opt, DIFF_SYMBOL_SUMMARY,
6825 sb.buf, sb.len, 0);
6826 strbuf_release(&sb);
6827 }
6828 show_mode_change(opt, p, !p->score);
6829 break;
6830 }
6831}
6832
6833struct patch_id_t {
6834 struct git_hash_ctx *ctx;

Callers 1

diff_flushFunction · 0.85

Calls 9

strbuf_addstrFunction · 0.85
quote_c_styleFunction · 0.85
strbuf_addfFunction · 0.85
similarity_indexFunction · 0.85
emit_diff_symbolFunction · 0.85
strbuf_releaseFunction · 0.85
show_file_mode_nameFunction · 0.70
show_rename_copyFunction · 0.70
show_mode_changeFunction · 0.70

Tested by

no test coverage detected