@@ -882,7 +882,8 @@ static int push_refs_with_push(struct transport *transport,
882
882
struct strbuf cas = STRBUF_INIT ;
883
883
strbuf_addf (& cas , "%s:%s" ,
884
884
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 ));
886
887
}
887
888
}
888
889
if (buf .len == 0 ) {
@@ -897,6 +898,7 @@ static int push_refs_with_push(struct transport *transport,
897
898
strbuf_addch (& buf , '\n' );
898
899
sendline (data , & buf );
899
900
strbuf_release (& buf );
901
+ string_list_clear (& cas_options , 0 );
900
902
901
903
return push_update_refs_status (data , remote_refs , flags );
902
904
}
@@ -930,7 +932,8 @@ static int push_refs_with_export(struct transport *transport,
930
932
private = apply_refspecs (data -> refspecs , data -> refspec_nr , ref -> name );
931
933
if (private && !get_oid (private , & oid )) {
932
934
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 ));
934
937
oidcpy (& ref -> old_oid , & oid );
935
938
}
936
939
free (private );
0 commit comments