diff options
Diffstat (limited to 'diff.h')
| -rw-r--r-- | diff.h | 21 |
1 files changed, 14 insertions, 7 deletions
@@ -205,9 +205,8 @@ static inline void diff_flags_or(struct diff_flags *a, { char *tmp_a = (char *)a; const char *tmp_b = (const char *)b; - int i; - for (i = 0; i < sizeof(struct diff_flags); i++) + for (size_t i = 0; i < sizeof(struct diff_flags); i++) tmp_a[i] |= tmp_b[i]; } @@ -463,7 +462,7 @@ const char *diff_line_prefix(struct diff_options *); extern const char mime_boundary_leader[]; struct combine_diff_path *diff_tree_paths( - struct combine_diff_path *p, const struct object_id *oid, + const struct object_id *oid, const struct object_id **parents_oid, int nparent, struct strbuf *base, struct diff_options *opt); void diff_tree_oid(const struct object_id *old_oid, @@ -481,12 +480,20 @@ struct combine_diff_path { char status; unsigned int mode; struct object_id oid; - struct strbuf path; + /* + * This per-parent path is filled only when doing a combined + * diff with revs.combined_all_paths set, and only if the path + * differs from the post-image (e.g., a rename or copy). + * Otherwise it is left NULL. + */ + char *path; } parent[FLEX_ARRAY]; }; -#define combine_diff_path_size(n, l) \ - st_add4(sizeof(struct combine_diff_path), (l), 1, \ - st_mult(sizeof(struct combine_diff_parent), (n))) +struct combine_diff_path *combine_diff_path_new(const char *path, + size_t path_len, + unsigned int mode, + const struct object_id *oid, + size_t num_parents); void show_combined_diff(struct combine_diff_path *elem, int num_parent, struct rev_info *); |
