@@ -148,7 +148,7 @@ int reftable_writer_new(struct reftable_writer **out,
148148
149149 reftable_buf_init (& wp -> block_writer_data .last_key );
150150 reftable_buf_init (& wp -> last_key );
151- reftable_buf_init (& wp -> buf );
151+ reftable_buf_init (& wp -> scratch );
152152 REFTABLE_CALLOC_ARRAY (wp -> block , opts .block_size );
153153 if (!wp -> block ) {
154154 reftable_free (wp );
@@ -181,7 +181,7 @@ static void writer_release(struct reftable_writer *w)
181181 w -> block_writer = NULL ;
182182 writer_clear_index (w );
183183 reftable_buf_release (& w -> last_key );
184- reftable_buf_release (& w -> buf );
184+ reftable_buf_release (& w -> scratch );
185185 }
186186}
187187
@@ -253,17 +253,17 @@ static int writer_add_record(struct reftable_writer *w,
253253{
254254 int err ;
255255
256- err = reftable_record_key (rec , & w -> buf );
256+ err = reftable_record_key (rec , & w -> scratch );
257257 if (err < 0 )
258258 goto done ;
259259
260- if (reftable_buf_cmp (& w -> last_key , & w -> buf ) >= 0 ) {
260+ if (reftable_buf_cmp (& w -> last_key , & w -> scratch ) >= 0 ) {
261261 err = REFTABLE_API_ERROR ;
262262 goto done ;
263263 }
264264
265265 reftable_buf_reset (& w -> last_key );
266- err = reftable_buf_add (& w -> last_key , w -> buf .buf , w -> buf .len );
266+ err = reftable_buf_add (& w -> last_key , w -> scratch .buf , w -> scratch .len );
267267 if (err < 0 )
268268 goto done ;
269269
@@ -339,25 +339,25 @@ int reftable_writer_add_ref(struct reftable_writer *w,
339339 goto out ;
340340
341341 if (!w -> opts .skip_index_objects && reftable_ref_record_val1 (ref )) {
342- reftable_buf_reset (& w -> buf );
343- err = reftable_buf_add (& w -> buf , (char * )reftable_ref_record_val1 (ref ),
342+ reftable_buf_reset (& w -> scratch );
343+ err = reftable_buf_add (& w -> scratch , (char * )reftable_ref_record_val1 (ref ),
344344 hash_size (w -> opts .hash_id ));
345345 if (err < 0 )
346346 goto out ;
347347
348- err = writer_index_hash (w , & w -> buf );
348+ err = writer_index_hash (w , & w -> scratch );
349349 if (err < 0 )
350350 goto out ;
351351 }
352352
353353 if (!w -> opts .skip_index_objects && reftable_ref_record_val2 (ref )) {
354- reftable_buf_reset (& w -> buf );
355- err = reftable_buf_add (& w -> buf , reftable_ref_record_val2 (ref ),
354+ reftable_buf_reset (& w -> scratch );
355+ err = reftable_buf_add (& w -> scratch , reftable_ref_record_val2 (ref ),
356356 hash_size (w -> opts .hash_id ));
357357 if (err < 0 )
358358 goto out ;
359359
360- err = writer_index_hash (w , & w -> buf );
360+ err = writer_index_hash (w , & w -> scratch );
361361 if (err < 0 )
362362 goto out ;
363363 }
0 commit comments