@@ -58,7 +58,7 @@ static int pack_objects(int fd, struct ref *refs, struct extra_have_objects *ext
5858 argv [i ++ ] = "--thin" ;
5959 if (args -> use_ofs_delta )
6060 argv [i ++ ] = "--delta-base-offset" ;
61- if (args -> quiet )
61+ if (args -> quiet || ! args -> progress )
6262 argv [i ++ ] = "-q" ;
6363 if (args -> progress )
6464 argv [i ++ ] = "--progress" ;
@@ -250,6 +250,7 @@ int send_pack(struct send_pack_args *args,
250250 int allow_deleting_refs = 0 ;
251251 int status_report = 0 ;
252252 int use_sideband = 0 ;
253+ int quiet_supported = 0 ;
253254 unsigned cmds_sent = 0 ;
254255 int ret ;
255256 struct async demux ;
@@ -263,8 +264,8 @@ int send_pack(struct send_pack_args *args,
263264 args -> use_ofs_delta = 1 ;
264265 if (server_supports ("side-band-64k" ))
265266 use_sideband = 1 ;
266- if (! server_supports ("quiet" ))
267- args -> quiet = 0 ;
267+ if (server_supports ("quiet" ))
268+ quiet_supported = 1 ;
268269
269270 if (!remote_refs ) {
270271 fprintf (stderr , "No refs in common and none specified; doing nothing.\n"
@@ -302,17 +303,18 @@ int send_pack(struct send_pack_args *args,
302303 } else {
303304 char * old_hex = sha1_to_hex (ref -> old_sha1 );
304305 char * new_hex = sha1_to_hex (ref -> new_sha1 );
306+ int quiet = quiet_supported && (args -> quiet || !args -> progress );
305307
306308 if (!cmds_sent && (status_report || use_sideband || args -> quiet )) {
307309 packet_buf_write (& req_buf , "%s %s %s%c%s%s%s" ,
308- old_hex , new_hex , ref -> name , 0 ,
309- status_report ? " report-status" : "" ,
310- use_sideband ? " side-band-64k" : "" ,
311- args -> quiet ? " quiet" : "" );
310+ old_hex , new_hex , ref -> name , 0 ,
311+ status_report ? " report-status" : "" ,
312+ use_sideband ? " side-band-64k" : "" ,
313+ quiet ? " quiet" : "" );
312314 }
313315 else
314316 packet_buf_write (& req_buf , "%s %s %s" ,
315- old_hex , new_hex , ref -> name );
317+ old_hex , new_hex , ref -> name );
316318 ref -> status = status_report ?
317319 REF_STATUS_EXPECTING_REPORT :
318320 REF_STATUS_OK ;
0 commit comments