Skip to content

Commit 89b0c4b

Browse files
author
Junio C Hamano
committed
Fix type of combine-diff.c::show_patch_diff()
The other function, show_raw_diff() is void and no callers use return value from neither. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 182a8da commit 89b0c4b

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

combine-diff.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -609,15 +609,15 @@ static void dump_quoted_path(const char *prefix, const char *path,
609609
printf("%s\n", c_reset);
610610
}
611611

612-
static int show_patch_diff(struct combine_diff_path *elem, int num_parent,
613-
int dense, struct rev_info *rev)
612+
static void show_patch_diff(struct combine_diff_path *elem, int num_parent,
613+
int dense, struct rev_info *rev)
614614
{
615615
struct diff_options *opt = &rev->diffopt;
616616
unsigned long result_size, cnt, lno;
617617
char *result, *cp;
618618
struct sline *sline; /* survived lines */
619619
int mode_differs = 0;
620-
int i, show_hunks, shown_header = 0;
620+
int i, show_hunks;
621621
int working_tree_file = !memcmp(elem->sha1, null_sha1, 20);
622622
int abbrev = opt->full_index ? 40 : DEFAULT_ABBREV;
623623
mmfile_t result_file;
@@ -769,7 +769,6 @@ static int show_patch_diff(struct combine_diff_path *elem, int num_parent,
769769
}
770770
free(sline[0].p_lno);
771771
free(sline);
772-
return shown_header;
773772
}
774773

775774
#define COLONS "::::::::::::::::::::::::::::::::"
@@ -837,11 +836,10 @@ void show_combined_diff(struct combine_diff_path *p,
837836
return;
838837
if (opt->output_format & (DIFF_FORMAT_RAW |
839838
DIFF_FORMAT_NAME |
840-
DIFF_FORMAT_NAME_STATUS)) {
839+
DIFF_FORMAT_NAME_STATUS))
841840
show_raw_diff(p, num_parent, rev);
842-
} else if (opt->output_format & DIFF_FORMAT_PATCH) {
841+
else if (opt->output_format & DIFF_FORMAT_PATCH)
843842
show_patch_diff(p, num_parent, dense, rev);
844-
}
845843
}
846844

847845
void diff_tree_combined(const unsigned char *sha1,

0 commit comments

Comments
 (0)