@@ -891,8 +891,8 @@ struct write_commit_graph_context {
891
891
const struct bloom_filter_settings * bloom_settings ;
892
892
};
893
893
894
- static void write_graph_chunk_fanout (struct hashfile * f ,
895
- struct write_commit_graph_context * ctx )
894
+ static int write_graph_chunk_fanout (struct hashfile * f ,
895
+ struct write_commit_graph_context * ctx )
896
896
{
897
897
int i , count = 0 ;
898
898
struct commit * * list = ctx -> commits .list ;
@@ -913,17 +913,21 @@ static void write_graph_chunk_fanout(struct hashfile *f,
913
913
914
914
hashwrite_be32 (f , count );
915
915
}
916
+
917
+ return 0 ;
916
918
}
917
919
918
- static void write_graph_chunk_oids (struct hashfile * f , int hash_len ,
919
- struct write_commit_graph_context * ctx )
920
+ static int write_graph_chunk_oids (struct hashfile * f ,
921
+ struct write_commit_graph_context * ctx )
920
922
{
921
923
struct commit * * list = ctx -> commits .list ;
922
924
int count ;
923
925
for (count = 0 ; count < ctx -> commits .nr ; count ++ , list ++ ) {
924
926
display_progress (ctx -> progress , ++ ctx -> progress_cnt );
925
- hashwrite (f , (* list )-> object .oid .hash , ( int ) hash_len );
927
+ hashwrite (f , (* list )-> object .oid .hash , the_hash_algo -> rawsz );
926
928
}
929
+
930
+ return 0 ;
927
931
}
928
932
929
933
static const unsigned char * commit_to_sha1 (size_t index , void * table )
@@ -932,8 +936,8 @@ static const unsigned char *commit_to_sha1(size_t index, void *table)
932
936
return commits [index ]-> object .oid .hash ;
933
937
}
934
938
935
- static void write_graph_chunk_data (struct hashfile * f , int hash_len ,
936
- struct write_commit_graph_context * ctx )
939
+ static int write_graph_chunk_data (struct hashfile * f ,
940
+ struct write_commit_graph_context * ctx )
937
941
{
938
942
struct commit * * list = ctx -> commits .list ;
939
943
struct commit * * last = ctx -> commits .list + ctx -> commits .nr ;
@@ -950,7 +954,7 @@ static void write_graph_chunk_data(struct hashfile *f, int hash_len,
950
954
die (_ ("unable to parse commit %s" ),
951
955
oid_to_hex (& (* list )-> object .oid ));
952
956
tree = get_commit_tree_oid (* list );
953
- hashwrite (f , tree -> hash , hash_len );
957
+ hashwrite (f , tree -> hash , the_hash_algo -> rawsz );
954
958
955
959
parent = (* list )-> parents ;
956
960
@@ -1030,10 +1034,12 @@ static void write_graph_chunk_data(struct hashfile *f, int hash_len,
1030
1034
1031
1035
list ++ ;
1032
1036
}
1037
+
1038
+ return 0 ;
1033
1039
}
1034
1040
1035
- static void write_graph_chunk_extra_edges (struct hashfile * f ,
1036
- struct write_commit_graph_context * ctx )
1041
+ static int write_graph_chunk_extra_edges (struct hashfile * f ,
1042
+ struct write_commit_graph_context * ctx )
1037
1043
{
1038
1044
struct commit * * list = ctx -> commits .list ;
1039
1045
struct commit * * last = ctx -> commits .list + ctx -> commits .nr ;
@@ -1082,10 +1088,12 @@ static void write_graph_chunk_extra_edges(struct hashfile *f,
1082
1088
1083
1089
list ++ ;
1084
1090
}
1091
+
1092
+ return 0 ;
1085
1093
}
1086
1094
1087
- static void write_graph_chunk_bloom_indexes (struct hashfile * f ,
1088
- struct write_commit_graph_context * ctx )
1095
+ static int write_graph_chunk_bloom_indexes (struct hashfile * f ,
1096
+ struct write_commit_graph_context * ctx )
1089
1097
{
1090
1098
struct commit * * list = ctx -> commits .list ;
1091
1099
struct commit * * last = ctx -> commits .list + ctx -> commits .nr ;
@@ -1108,6 +1116,7 @@ static void write_graph_chunk_bloom_indexes(struct hashfile *f,
1108
1116
}
1109
1117
1110
1118
stop_progress (& progress );
1119
+ return 0 ;
1111
1120
}
1112
1121
1113
1122
static void trace2_bloom_filter_settings (struct write_commit_graph_context * ctx )
@@ -1125,8 +1134,8 @@ static void trace2_bloom_filter_settings(struct write_commit_graph_context *ctx)
1125
1134
jw_release (& jw );
1126
1135
}
1127
1136
1128
- static void write_graph_chunk_bloom_data (struct hashfile * f ,
1129
- struct write_commit_graph_context * ctx )
1137
+ static int write_graph_chunk_bloom_data (struct hashfile * f ,
1138
+ struct write_commit_graph_context * ctx )
1130
1139
{
1131
1140
struct commit * * list = ctx -> commits .list ;
1132
1141
struct commit * * last = ctx -> commits .list + ctx -> commits .nr ;
@@ -1155,6 +1164,7 @@ static void write_graph_chunk_bloom_data(struct hashfile *f,
1155
1164
}
1156
1165
1157
1166
stop_progress (& progress );
1167
+ return 0 ;
1158
1168
}
1159
1169
1160
1170
static int oid_compare (const void * _a , const void * _b )
@@ -1671,8 +1681,8 @@ static int write_commit_graph_file(struct write_commit_graph_context *ctx)
1671
1681
num_chunks * ctx -> commits .nr );
1672
1682
}
1673
1683
write_graph_chunk_fanout (f , ctx );
1674
- write_graph_chunk_oids (f , hashsz , ctx );
1675
- write_graph_chunk_data (f , hashsz , ctx );
1684
+ write_graph_chunk_oids (f , ctx );
1685
+ write_graph_chunk_data (f , ctx );
1676
1686
if (ctx -> num_extra_edges )
1677
1687
write_graph_chunk_extra_edges (f , ctx );
1678
1688
if (ctx -> changed_paths ) {
0 commit comments