@@ -278,8 +278,8 @@ static int fetch_objs_via_rsync(struct transport *transport,
278
278
return run_command (& rsync );
279
279
}
280
280
281
- static int write_one_ref (const char * name , const unsigned char * sha1 ,
282
- int flags , void * data )
281
+ static int write_one_ref (const char * name , const struct object_id * oid ,
282
+ int flags , void * data )
283
283
{
284
284
struct strbuf * buf = data ;
285
285
int len = buf -> len ;
@@ -291,7 +291,7 @@ static int write_one_ref(const char *name, const unsigned char *sha1,
291
291
292
292
strbuf_addstr (buf , name );
293
293
if (safe_create_leading_directories (buf -> buf ) ||
294
- write_file (buf -> buf , 0 , "%s\n" , sha1_to_hex ( sha1 )))
294
+ write_file (buf -> buf , 0 , "%s\n" , oid_to_hex ( oid )))
295
295
return error ("problems writing temporary file %s: %s" ,
296
296
buf -> buf , strerror (errno ));
297
297
strbuf_setlen (buf , len );
@@ -310,7 +310,7 @@ static int write_refs_to_temp_dir(struct strbuf *temp_dir,
310
310
if (dwim_ref (refspec [i ], strlen (refspec [i ]), oid .hash , & ref ) != 1 )
311
311
return error ("Could not get ref %s" , refspec [i ]);
312
312
313
- if (write_one_ref (ref , oid . hash , 0 , temp_dir )) {
313
+ if (write_one_ref (ref , & oid , 0 , temp_dir )) {
314
314
free (ref );
315
315
return -1 ;
316
316
}
@@ -363,10 +363,7 @@ static int rsync_transport_push(struct transport *transport,
363
363
strbuf_addch (& temp_dir , '/' );
364
364
365
365
if (flags & TRANSPORT_PUSH_ALL ) {
366
- struct each_ref_fn_sha1_adapter wrapped_write_one_ref =
367
- {write_one_ref , & temp_dir };
368
-
369
- if (for_each_ref (each_ref_fn_adapter , & wrapped_write_one_ref ))
366
+ if (for_each_ref (write_one_ref , & temp_dir ))
370
367
return -1 ;
371
368
} else if (write_refs_to_temp_dir (& temp_dir , refspec_nr , refspec ))
372
369
return -1 ;
0 commit comments