@@ -33,6 +33,7 @@ static int transfer_unpack_limit = -1;
3333static int unpack_limit = 100 ;
3434static int report_status ;
3535static int use_sideband ;
36+ static int quiet ;
3637static int prefer_ofs_delta = 1 ;
3738static int auto_update_server_info ;
3839static int auto_gc = 1 ;
@@ -122,7 +123,7 @@ static void show_ref(const char *path, const unsigned char *sha1)
122123 else
123124 packet_write (1 , "%s %s%c%s%s\n" ,
124125 sha1_to_hex (sha1 ), path , 0 ,
125- " report-status delete-refs side-band-64k" ,
126+ " report-status delete-refs side-band-64k quiet " ,
126127 prefer_ofs_delta ? " ofs-delta" : "" );
127128 sent_capabilities = 1 ;
128129}
@@ -748,10 +749,13 @@ static struct command *read_head_info(void)
748749 refname = line + 82 ;
749750 reflen = strlen (refname );
750751 if (reflen + 82 < len ) {
751- if (strstr (refname + reflen + 1 , "report-status" ))
752+ const char * feature_list = refname + reflen + 1 ;
753+ if (parse_feature_request (feature_list , "report-status" ))
752754 report_status = 1 ;
753- if (strstr ( refname + reflen + 1 , "side-band-64k" ))
755+ if (parse_feature_request ( feature_list , "side-band-64k" ))
754756 use_sideband = LARGE_PACKET_MAX ;
757+ if (parse_feature_request (feature_list , "quiet" ))
758+ quiet = 1 ;
755759 }
756760 cmd = xcalloc (1 , sizeof (struct command ) + len - 80 );
757761 hashcpy (cmd -> old_sha1 , old_sha1 );
@@ -805,8 +809,10 @@ static const char *unpack(void)
805809
806810 if (ntohl (hdr .hdr_entries ) < unpack_limit ) {
807811 int code , i = 0 ;
808- const char * unpacker [4 ];
812+ const char * unpacker [5 ];
809813 unpacker [i ++ ] = "unpack-objects" ;
814+ if (quiet )
815+ unpacker [i ++ ] = "-q" ;
810816 if (fsck_objects )
811817 unpacker [i ++ ] = "--strict" ;
812818 unpacker [i ++ ] = hdr_arg ;
@@ -901,6 +907,11 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix)
901907 const char * arg = * argv ++ ;
902908
903909 if (* arg == '-' ) {
910+ if (!strcmp (arg , "--quiet" )) {
911+ quiet = 1 ;
912+ continue ;
913+ }
914+
904915 if (!strcmp (arg , "--advertise-refs" )) {
905916 advertise_refs = 1 ;
906917 continue ;
0 commit comments