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

Function get_compact_summary

diff.c:4156–4180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4154}
4155
4156static const char *get_compact_summary(const struct diff_filepair *p, int is_renamed)
4157{
4158 if (!is_renamed) {
4159 if (p->status == DIFF_STATUS_ADDED) {
4160 if (S_ISLNK(p->two->mode))
4161 return "new +l";
4162 else if ((p->two->mode & 0777) == 0755)
4163 return "new +x";
4164 else
4165 return "new";
4166 } else if (p->status == DIFF_STATUS_DELETED)
4167 return "gone";
4168 }
4169 if (S_ISLNK(p->one->mode) && !S_ISLNK(p->two->mode))
4170 return "mode -l";
4171 else if (!S_ISLNK(p->one->mode) && S_ISLNK(p->two->mode))
4172 return "mode +l";
4173 else if ((p->one->mode & 0777) == 0644 &&
4174 (p->two->mode & 0777) == 0755)
4175 return "mode +x";
4176 else if ((p->one->mode & 0777) == 0755 &&
4177 (p->two->mode & 0777) == 0644)
4178 return "mode -x";
4179 return NULL;
4180}
4181
4182static void builtin_diffstat(const char *name_a, const char *name_b,
4183 struct diff_filespec *one,

Callers 1

builtin_diffstatFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected