@@ -882,7 +882,8 @@ static int push_refs_with_push(struct transport *transport,
882882 struct strbuf cas = STRBUF_INIT ;
883883 strbuf_addf (& cas , "%s:%s" ,
884884 ref -> name , oid_to_hex (& ref -> old_oid_expect ));
885- string_list_append (& cas_options , strbuf_detach (& cas , NULL ));
885+ string_list_append_nodup (& cas_options ,
886+ strbuf_detach (& cas , NULL ));
886887 }
887888 }
888889 if (buf .len == 0 ) {
@@ -897,6 +898,7 @@ static int push_refs_with_push(struct transport *transport,
897898 strbuf_addch (& buf , '\n' );
898899 sendline (data , & buf );
899900 strbuf_release (& buf );
901+ string_list_clear (& cas_options , 0 );
900902
901903 return push_update_refs_status (data , remote_refs , flags );
902904}
@@ -930,7 +932,8 @@ static int push_refs_with_export(struct transport *transport,
930932 private = apply_refspecs (data -> refspecs , data -> refspec_nr , ref -> name );
931933 if (private && !get_oid (private , & oid )) {
932934 strbuf_addf (& buf , "^%s" , private );
933- string_list_append (& revlist_args , strbuf_detach (& buf , NULL ));
935+ string_list_append_nodup (& revlist_args ,
936+ strbuf_detach (& buf , NULL ));
934937 oidcpy (& ref -> old_oid , & oid );
935938 }
936939 free (private );
0 commit comments