| 4154 | } |
| 4155 | |
| 4156 | static 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 | |
| 4182 | static void builtin_diffstat(const char *name_a, const char *name_b, |
| 4183 | struct diff_filespec *one, |