@@ -566,7 +566,7 @@ static int read_remote_branches(const char *refname,
566
566
567
567
strbuf_addf (& buf , "refs/remotes/%s/" , rename -> old_name );
568
568
if (starts_with (refname , buf .buf )) {
569
- item = string_list_append (rename -> remote_branches , xstrdup ( refname ) );
569
+ item = string_list_append (rename -> remote_branches , refname );
570
570
symref = resolve_ref_unsafe (refname , RESOLVE_REF_READING ,
571
571
NULL , & flag );
572
572
if (symref && (flag & REF_ISSYMREF ))
@@ -612,7 +612,7 @@ static int mv(int argc, const char **argv)
612
612
struct remote * oldremote , * newremote ;
613
613
struct strbuf buf = STRBUF_INIT , buf2 = STRBUF_INIT , buf3 = STRBUF_INIT ,
614
614
old_remote_context = STRBUF_INIT ;
615
- struct string_list remote_branches = STRING_LIST_INIT_NODUP ;
615
+ struct string_list remote_branches = STRING_LIST_INIT_DUP ;
616
616
struct rename_info rename ;
617
617
int i , refspec_updated = 0 ;
618
618
@@ -734,6 +734,7 @@ static int mv(int argc, const char **argv)
734
734
if (create_symref (buf .buf , buf2 .buf , buf3 .buf ))
735
735
die (_ ("creating '%s' failed" ), buf .buf );
736
736
}
737
+ string_list_clear (& remote_branches , 1 );
737
738
return 0 ;
738
739
}
739
740
0 commit comments