@@ -87,7 +87,7 @@ static int opt_parse_track(const struct option *opt, const char *arg, int not)
8787 if (not )
8888 string_list_clear (list , 0 );
8989 else
90- string_list_append (arg , list );
90+ string_list_append (list , arg );
9191 return 0 ;
9292}
9393
@@ -160,7 +160,7 @@ static int add(int argc, const char **argv)
160160 strbuf_addf (& buf , "remote.%s.fetch" , name );
161161
162162 if (track .nr == 0 )
163- string_list_append ("*" , & track );
163+ string_list_append (& track , "*" );
164164 for (i = 0 ; i < track .nr ; i ++ ) {
165165 struct string_list_item * item = track .items + i ;
166166
@@ -266,11 +266,11 @@ static int config_read_branches(const char *key, const char *value, void *cb)
266266 while (space ) {
267267 char * merge ;
268268 merge = xstrndup (value , space - value );
269- string_list_append (merge , & info -> merge );
269+ string_list_append (& info -> merge , merge );
270270 value = abbrev_branch (space + 1 );
271271 space = strchr (value , ' ' );
272272 }
273- string_list_append (xstrdup ( value ), & info -> merge );
273+ string_list_append (& info -> merge , xstrdup ( value ) );
274274 } else
275275 info -> rebase = git_config_bool (orig_key , value );
276276 }
@@ -307,14 +307,14 @@ static int get_ref_states(const struct ref *remote_refs, struct ref_states *stat
307307 for (ref = fetch_map ; ref ; ref = ref -> next ) {
308308 unsigned char sha1 [20 ];
309309 if (!ref -> peer_ref || read_ref (ref -> peer_ref -> name , sha1 ))
310- string_list_append (abbrev_branch (ref -> name ), & states -> new );
310+ string_list_append (& states -> new , abbrev_branch (ref -> name ));
311311 else
312- string_list_append (abbrev_branch (ref -> name ), & states -> tracked );
312+ string_list_append (& states -> tracked , abbrev_branch (ref -> name ));
313313 }
314314 stale_refs = get_stale_heads (states -> remote , fetch_map );
315315 for (ref = stale_refs ; ref ; ref = ref -> next ) {
316316 struct string_list_item * item =
317- string_list_append (abbrev_branch (ref -> name ), & states -> stale );
317+ string_list_append (& states -> stale , abbrev_branch (ref -> name ));
318318 item -> util = xstrdup (ref -> name );
319319 }
320320 free_refs (stale_refs );
@@ -363,8 +363,8 @@ static int get_push_ref_states(const struct ref *remote_refs,
363363 continue ;
364364 hashcpy (ref -> new_sha1 , ref -> peer_ref -> new_sha1 );
365365
366- item = string_list_append (abbrev_branch ( ref -> peer_ref -> name ) ,
367- & states -> push );
366+ item = string_list_append (& states -> push ,
367+ abbrev_branch ( ref -> peer_ref -> name ) );
368368 item -> util = xcalloc (sizeof (struct push_info ), 1 );
369369 info = item -> util ;
370370 info -> forced = ref -> force ;
@@ -399,19 +399,19 @@ static int get_push_ref_states_noquery(struct ref_states *states)
399399
400400 states -> push .strdup_strings = 1 ;
401401 if (!remote -> push_refspec_nr ) {
402- item = string_list_append ("(matching)" , & states -> push );
402+ item = string_list_append (& states -> push , "(matching)" );
403403 info = item -> util = xcalloc (sizeof (struct push_info ), 1 );
404404 info -> status = PUSH_STATUS_NOTQUERIED ;
405405 info -> dest = xstrdup (item -> string );
406406 }
407407 for (i = 0 ; i < remote -> push_refspec_nr ; i ++ ) {
408408 struct refspec * spec = remote -> push + i ;
409409 if (spec -> matching )
410- item = string_list_append ("(matching)" , & states -> push );
410+ item = string_list_append (& states -> push , "(matching)" );
411411 else if (strlen (spec -> src ))
412- item = string_list_append (spec -> src , & states -> push );
412+ item = string_list_append (& states -> push , spec -> src );
413413 else
414- item = string_list_append ("(delete)" , & states -> push );
414+ item = string_list_append (& states -> push , "(delete)" );
415415
416416 info = item -> util = xcalloc (sizeof (struct push_info ), 1 );
417417 info -> forced = spec -> force ;
@@ -435,7 +435,7 @@ static int get_head_names(const struct ref *remote_refs, struct ref_states *stat
435435 matches = guess_remote_head (find_ref_by_name (remote_refs , "HEAD" ),
436436 fetch_map , 1 );
437437 for (ref = matches ; ref ; ref = ref -> next )
438- string_list_append (abbrev_branch (ref -> name ), & states -> heads );
438+ string_list_append (& states -> heads , abbrev_branch (ref -> name ));
439439
440440 free_refs (fetch_map );
441441 free_refs (matches );
@@ -499,8 +499,8 @@ static int add_branch_for_removal(const char *refname,
499499 if (prefixcmp (refname , "refs/remotes" )) {
500500 /* advise user how to delete local branches */
501501 if (!prefixcmp (refname , "refs/heads/" ))
502- string_list_append (abbrev_branch ( refname ) ,
503- branches -> skipped );
502+ string_list_append (branches -> skipped ,
503+ abbrev_branch ( refname ) );
504504 /* silently skip over other non-remote refs */
505505 return 0 ;
506506 }
@@ -509,7 +509,7 @@ static int add_branch_for_removal(const char *refname,
509509 if (flags & REF_ISSYMREF )
510510 return unlink (git_path ("%s" , refname ));
511511
512- item = string_list_append (refname , branches -> branches );
512+ item = string_list_append (branches -> branches , refname );
513513 item -> util = xmalloc (20 );
514514 hashcpy (item -> util , sha1 );
515515
@@ -534,7 +534,7 @@ static int read_remote_branches(const char *refname,
534534
535535 strbuf_addf (& buf , "refs/remotes/%s" , rename -> old );
536536 if (!prefixcmp (refname , buf .buf )) {
537- item = string_list_append (xstrdup ( refname ), rename -> remote_branches );
537+ item = string_list_append (rename -> remote_branches , xstrdup ( refname ) );
538538 symref = resolve_ref (refname , orig_sha1 , 1 , & flag );
539539 if (flag & REF_ISSYMREF )
540540 item -> util = xstrdup (symref );
@@ -817,7 +817,7 @@ static int append_ref_to_tracked_list(const char *refname,
817817 memset (& refspec , 0 , sizeof (refspec ));
818818 refspec .dst = (char * )refname ;
819819 if (!remote_find_tracking (states -> remote , & refspec ))
820- string_list_append (abbrev_branch (refspec .src ), & states -> tracked );
820+ string_list_append (& states -> tracked , abbrev_branch (refspec .src ));
821821
822822 return 0 ;
823823}
@@ -965,7 +965,7 @@ static int add_push_to_show_info(struct string_list_item *push_item, void *cb_da
965965 show_info -> width = n ;
966966 if ((n = strlen (push_info -> dest )) > show_info -> width2 )
967967 show_info -> width2 = n ;
968- item = string_list_append (push_item -> string , show_info -> list );
968+ item = string_list_append (show_info -> list , push_item -> string );
969969 item -> util = push_item -> util ;
970970 return 0 ;
971971}
@@ -1379,10 +1379,10 @@ static int get_one_entry(struct remote *remote, void *priv)
13791379
13801380 if (remote -> url_nr > 0 ) {
13811381 strbuf_addf (& url_buf , "%s (fetch)" , remote -> url [0 ]);
1382- string_list_append (remote -> name , list )-> util =
1382+ string_list_append (list , remote -> name )-> util =
13831383 strbuf_detach (& url_buf , NULL );
13841384 } else
1385- string_list_append (remote -> name , list )-> util = NULL ;
1385+ string_list_append (list , remote -> name )-> util = NULL ;
13861386 if (remote -> pushurl_nr ) {
13871387 url = remote -> pushurl ;
13881388 url_nr = remote -> pushurl_nr ;
@@ -1393,7 +1393,7 @@ static int get_one_entry(struct remote *remote, void *priv)
13931393 for (i = 0 ; i < url_nr ; i ++ )
13941394 {
13951395 strbuf_addf (& url_buf , "%s (push)" , url [i ]);
1396- string_list_append (remote -> name , list )-> util =
1396+ string_list_append (list , remote -> name )-> util =
13971397 strbuf_detach (& url_buf , NULL );
13981398 }
13991399
0 commit comments