summaryrefslogtreecommitdiff
path: root/combine-diff.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2013-02-25 08:03:51 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-02-25 08:03:51 -0800
commitd49f9f178b7efbe45cdd4288a9a7a6a0f023c9e3 (patch)
tree41ba4a5667706e9ed03a3ada1979273bb3fe0ba6 /combine-diff.c
parentMerge branch 'jk/apply-similaritly-parsing' into maint (diff)
parentt4038: add tests for "diff --cc --raw <trees>" (diff)
downloadtgif-d49f9f178b7efbe45cdd4288a9a7a6a0f023c9e3.tar.xz
Merge branch 'jc/combine-diff-many-parents' into maint
* jc/combine-diff-many-parents: t4038: add tests for "diff --cc --raw <trees>" combine-diff: lift 32-way limit of combined diff
Diffstat (limited to 'combine-diff.c')
-rw-r--r--combine-diff.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/combine-diff.c b/combine-diff.c
index bb1cc96c4e..7f6187f9cd 100644
--- a/combine-diff.c
+++ b/combine-diff.c
@@ -982,14 +982,10 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent,
free(sline);
}
-#define COLONS "::::::::::::::::::::::::::::::::"
-
static void show_raw_diff(struct combine_diff_path *p, int num_parent, struct rev_info *rev)
{
struct diff_options *opt = &rev->diffopt;
- int i, offset;
- const char *prefix;
- int line_termination, inter_name_termination;
+ int line_termination, inter_name_termination, i;
line_termination = opt->line_termination;
inter_name_termination = '\t';
@@ -1000,17 +996,14 @@ static void show_raw_diff(struct combine_diff_path *p, int num_parent, struct re
show_log(rev);
if (opt->output_format & DIFF_FORMAT_RAW) {
- offset = strlen(COLONS) - num_parent;
- if (offset < 0)
- offset = 0;
- prefix = COLONS + offset;
+ /* As many colons as there are parents */
+ for (i = 0; i < num_parent; i++)
+ putchar(':');
/* Show the modes */
- for (i = 0; i < num_parent; i++) {
- printf("%s%06o", prefix, p->parent[i].mode);
- prefix = " ";
- }
- printf("%s%06o", prefix, p->mode);
+ for (i = 0; i < num_parent; i++)
+ printf("%06o ", p->parent[i].mode);
+ printf("%06o", p->mode);
/* Show sha1's */
for (i = 0; i < num_parent; i++)