@@ -768,7 +768,8 @@ static void show_combined_header(struct combine_diff_path *elem,
768
768
}
769
769
770
770
static void show_patch_diff (struct combine_diff_path * elem , int num_parent ,
771
- int dense , struct rev_info * rev )
771
+ int dense , int working_tree_file ,
772
+ struct rev_info * rev )
772
773
{
773
774
struct diff_options * opt = & rev -> diffopt ;
774
775
unsigned long result_size , cnt , lno ;
@@ -777,7 +778,6 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent,
777
778
struct sline * sline ; /* survived lines */
778
779
int mode_differs = 0 ;
779
780
int i , show_hunks ;
780
- int working_tree_file = is_null_sha1 (elem -> sha1 );
781
781
mmfile_t result_file ;
782
782
struct userdiff_driver * userdiff ;
783
783
struct userdiff_driver * textconv = NULL ;
@@ -1028,6 +1028,12 @@ static void show_raw_diff(struct combine_diff_path *p, int num_parent, struct re
1028
1028
write_name_quoted (p -> path , stdout , line_termination );
1029
1029
}
1030
1030
1031
+ /*
1032
+ * The result (p->elem) is from the working tree and their
1033
+ * parents are typically from multiple stages during a merge
1034
+ * (i.e. diff-files) or the state in HEAD and in the index
1035
+ * (i.e. diff-index).
1036
+ */
1031
1037
void show_combined_diff (struct combine_diff_path * p ,
1032
1038
int num_parent ,
1033
1039
int dense ,
@@ -1041,7 +1047,7 @@ void show_combined_diff(struct combine_diff_path *p,
1041
1047
DIFF_FORMAT_NAME_STATUS ))
1042
1048
show_raw_diff (p , num_parent , rev );
1043
1049
else if (opt -> output_format & DIFF_FORMAT_PATCH )
1044
- show_patch_diff (p , num_parent , dense , rev );
1050
+ show_patch_diff (p , num_parent , dense , 1 , rev );
1045
1051
}
1046
1052
1047
1053
void diff_tree_combined (const unsigned char * sha1 ,
@@ -1109,7 +1115,7 @@ void diff_tree_combined(const unsigned char *sha1,
1109
1115
for (p = paths ; p ; p = p -> next ) {
1110
1116
if (p -> len )
1111
1117
show_patch_diff (p , num_parent , dense ,
1112
- rev );
1118
+ 0 , rev );
1113
1119
}
1114
1120
}
1115
1121
}
0 commit comments