@@ -322,7 +322,7 @@ static void read_branches(void)
322322
323323struct ref_states {
324324 struct remote * remote ;
325- struct string_list new , stale , tracked , heads , push ;
325+ struct string_list new_refs , stale , tracked , heads , push ;
326326 int queried ;
327327};
328328
@@ -337,12 +337,12 @@ static int get_ref_states(const struct ref *remote_refs, struct ref_states *stat
337337 die (_ ("Could not get fetch map for refspec %s" ),
338338 states -> remote -> fetch_refspec [i ]);
339339
340- states -> new .strdup_strings = 1 ;
340+ states -> new_refs .strdup_strings = 1 ;
341341 states -> tracked .strdup_strings = 1 ;
342342 states -> stale .strdup_strings = 1 ;
343343 for (ref = fetch_map ; ref ; ref = ref -> next ) {
344344 if (!ref -> peer_ref || !ref_exists (ref -> peer_ref -> name ))
345- string_list_append (& states -> new , abbrev_branch (ref -> name ));
345+ string_list_append (& states -> new_refs , abbrev_branch (ref -> name ));
346346 else
347347 string_list_append (& states -> tracked , abbrev_branch (ref -> name ));
348348 }
@@ -356,7 +356,7 @@ static int get_ref_states(const struct ref *remote_refs, struct ref_states *stat
356356 free_refs (stale_refs );
357357 free_refs (fetch_map );
358358
359- string_list_sort (& states -> new );
359+ string_list_sort (& states -> new_refs );
360360 string_list_sort (& states -> tracked );
361361 string_list_sort (& states -> stale );
362362
@@ -546,8 +546,8 @@ static int add_branch_for_removal(const char *refname,
546546}
547547
548548struct rename_info {
549- const char * old ;
550- const char * new ;
549+ const char * old_name ;
550+ const char * new_name ;
551551 struct string_list * remote_branches ;
552552};
553553
@@ -560,7 +560,7 @@ static int read_remote_branches(const char *refname,
560560 int flag ;
561561 const char * symref ;
562562
563- strbuf_addf (& buf , "refs/remotes/%s/" , rename -> old );
563+ strbuf_addf (& buf , "refs/remotes/%s/" , rename -> old_name );
564564 if (starts_with (refname , buf .buf )) {
565565 item = string_list_append (rename -> remote_branches , xstrdup (refname ));
566566 symref = resolve_ref_unsafe (refname , RESOLVE_REF_READING ,
@@ -615,36 +615,36 @@ static int mv(int argc, const char **argv)
615615 if (argc != 3 )
616616 usage_with_options (builtin_remote_rename_usage , options );
617617
618- rename .old = argv [1 ];
619- rename .new = argv [2 ];
618+ rename .old_name = argv [1 ];
619+ rename .new_name = argv [2 ];
620620 rename .remote_branches = & remote_branches ;
621621
622- oldremote = remote_get (rename .old );
622+ oldremote = remote_get (rename .old_name );
623623 if (!remote_is_configured (oldremote , 1 ))
624- die (_ ("No such remote: %s" ), rename .old );
624+ die (_ ("No such remote: %s" ), rename .old_name );
625625
626- if (!strcmp (rename .old , rename .new ) && oldremote -> origin != REMOTE_CONFIG )
626+ if (!strcmp (rename .old_name , rename .new_name ) && oldremote -> origin != REMOTE_CONFIG )
627627 return migrate_file (oldremote );
628628
629- newremote = remote_get (rename .new );
629+ newremote = remote_get (rename .new_name );
630630 if (remote_is_configured (newremote , 1 ))
631- die (_ ("remote %s already exists." ), rename .new );
631+ die (_ ("remote %s already exists." ), rename .new_name );
632632
633- strbuf_addf (& buf , "refs/heads/test:refs/remotes/%s/test" , rename .new );
633+ strbuf_addf (& buf , "refs/heads/test:refs/remotes/%s/test" , rename .new_name );
634634 if (!valid_fetch_refspec (buf .buf ))
635- die (_ ("'%s' is not a valid remote name" ), rename .new );
635+ die (_ ("'%s' is not a valid remote name" ), rename .new_name );
636636
637637 strbuf_reset (& buf );
638- strbuf_addf (& buf , "remote.%s" , rename .old );
639- strbuf_addf (& buf2 , "remote.%s" , rename .new );
638+ strbuf_addf (& buf , "remote.%s" , rename .old_name );
639+ strbuf_addf (& buf2 , "remote.%s" , rename .new_name );
640640 if (git_config_rename_section (buf .buf , buf2 .buf ) < 1 )
641641 return error (_ ("Could not rename config section '%s' to '%s'" ),
642642 buf .buf , buf2 .buf );
643643
644644 strbuf_reset (& buf );
645- strbuf_addf (& buf , "remote.%s.fetch" , rename .new );
645+ strbuf_addf (& buf , "remote.%s.fetch" , rename .new_name );
646646 git_config_set_multivar (buf .buf , NULL , NULL , 1 );
647- strbuf_addf (& old_remote_context , ":refs/remotes/%s/" , rename .old );
647+ strbuf_addf (& old_remote_context , ":refs/remotes/%s/" , rename .old_name );
648648 for (i = 0 ; i < oldremote -> fetch_refspec_nr ; i ++ ) {
649649 char * ptr ;
650650
@@ -655,8 +655,8 @@ static int mv(int argc, const char **argv)
655655 refspec_updated = 1 ;
656656 strbuf_splice (& buf2 ,
657657 ptr - buf2 .buf + strlen (":refs/remotes/" ),
658- strlen (rename .old ), rename .new ,
659- strlen (rename .new ));
658+ strlen (rename .old_name ), rename .new_name ,
659+ strlen (rename .new_name ));
660660 } else
661661 warning (_ ("Not updating non-default fetch refspec\n"
662662 "\t%s\n"
@@ -670,10 +670,10 @@ static int mv(int argc, const char **argv)
670670 for (i = 0 ; i < branch_list .nr ; i ++ ) {
671671 struct string_list_item * item = branch_list .items + i ;
672672 struct branch_info * info = item -> util ;
673- if (info -> remote_name && !strcmp (info -> remote_name , rename .old )) {
673+ if (info -> remote_name && !strcmp (info -> remote_name , rename .old_name )) {
674674 strbuf_reset (& buf );
675675 strbuf_addf (& buf , "branch.%s.remote" , item -> string );
676- git_config_set (buf .buf , rename .new );
676+ git_config_set (buf .buf , rename .new_name );
677677 }
678678 }
679679
@@ -703,8 +703,8 @@ static int mv(int argc, const char **argv)
703703 continue ;
704704 strbuf_reset (& buf );
705705 strbuf_addstr (& buf , item -> string );
706- strbuf_splice (& buf , strlen ("refs/remotes/" ), strlen (rename .old ),
707- rename .new , strlen (rename .new ));
706+ strbuf_splice (& buf , strlen ("refs/remotes/" ), strlen (rename .old_name ),
707+ rename .new_name , strlen (rename .new_name ));
708708 strbuf_reset (& buf2 );
709709 strbuf_addf (& buf2 , "remote: renamed %s to %s" ,
710710 item -> string , buf .buf );
@@ -718,12 +718,12 @@ static int mv(int argc, const char **argv)
718718 continue ;
719719 strbuf_reset (& buf );
720720 strbuf_addstr (& buf , item -> string );
721- strbuf_splice (& buf , strlen ("refs/remotes/" ), strlen (rename .old ),
722- rename .new , strlen (rename .new ));
721+ strbuf_splice (& buf , strlen ("refs/remotes/" ), strlen (rename .old_name ),
722+ rename .new_name , strlen (rename .new_name ));
723723 strbuf_reset (& buf2 );
724724 strbuf_addstr (& buf2 , item -> util );
725- strbuf_splice (& buf2 , strlen ("refs/remotes/" ), strlen (rename .old ),
726- rename .new , strlen (rename .new ));
725+ strbuf_splice (& buf2 , strlen ("refs/remotes/" ), strlen (rename .old_name ),
726+ rename .new_name , strlen (rename .new_name ));
727727 strbuf_reset (& buf3 );
728728 strbuf_addf (& buf3 , "remote: renamed %s to %s" ,
729729 item -> string , buf .buf );
@@ -822,7 +822,7 @@ static void clear_push_info(void *util, const char *string)
822822
823823static void free_remote_ref_states (struct ref_states * states )
824824{
825- string_list_clear (& states -> new , 0 );
825+ string_list_clear (& states -> new_refs , 0 );
826826 string_list_clear (& states -> stale , 1 );
827827 string_list_clear (& states -> tracked , 0 );
828828 string_list_clear (& states -> heads , 0 );
@@ -907,7 +907,7 @@ static int show_remote_info_item(struct string_list_item *item, void *cb_data)
907907 if (states -> queried ) {
908908 const char * fmt = "%s" ;
909909 const char * arg = "" ;
910- if (string_list_has_string (& states -> new , name )) {
910+ if (string_list_has_string (& states -> new_refs , name )) {
911911 fmt = _ (" new (next fetch will store in remotes/%s)" );
912912 arg = states -> remote -> name ;
913913 } else if (string_list_has_string (& states -> tracked , name ))
@@ -1176,7 +1176,7 @@ static int show(int argc, const char **argv)
11761176
11771177 /* remote branch info */
11781178 info .width = 0 ;
1179- for_each_string_list (& states .new , add_remote_to_show_info , & info );
1179+ for_each_string_list (& states .new_refs , add_remote_to_show_info , & info );
11801180 for_each_string_list (& states .tracked , add_remote_to_show_info , & info );
11811181 for_each_string_list (& states .stale , add_remote_to_show_info , & info );
11821182 if (info .list -> nr )
0 commit comments