@@ -178,7 +178,6 @@ static const char tag_template_nocleanup[] =
178
178
static int git_tag_config (const char * var , const char * value , void * cb )
179
179
{
180
180
int status ;
181
- struct ref_sorting * * sorting_tail = (struct ref_sorting * * )cb ;
182
181
183
182
if (!strcmp (var , "tag.gpgsign" )) {
184
183
config_sign_tag = git_config_bool (var , value );
@@ -188,7 +187,7 @@ static int git_tag_config(const char *var, const char *value, void *cb)
188
187
if (!strcmp (var , "tag.sort" )) {
189
188
if (!value )
190
189
return config_error_nonbool (var );
191
- parse_ref_sorting ( sorting_tail , value );
190
+ string_list_append ( cb , value );
192
191
return 0 ;
193
192
}
194
193
@@ -436,7 +435,8 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
436
435
struct ref_transaction * transaction ;
437
436
struct strbuf err = STRBUF_INIT ;
438
437
struct ref_filter filter ;
439
- static struct ref_sorting * sorting = NULL , * * sorting_tail = & sorting ;
438
+ struct ref_sorting * sorting ;
439
+ struct string_list sorting_options = STRING_LIST_INIT_DUP ;
440
440
struct ref_format format = REF_FORMAT_INIT ;
441
441
int icase = 0 ;
442
442
int edit_flag = 0 ;
@@ -470,7 +470,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
470
470
OPT_WITHOUT (& filter .no_commit , N_ ("print only tags that don't contain the commit" )),
471
471
OPT_MERGED (& filter , N_ ("print only tags that are merged" )),
472
472
OPT_NO_MERGED (& filter , N_ ("print only tags that are not merged" )),
473
- OPT_REF_SORT (sorting_tail ),
473
+ OPT_REF_SORT (& sorting_options ),
474
474
{
475
475
OPTION_CALLBACK , 0 , "points-at" , & filter .points_at , N_ ("object" ),
476
476
N_ ("print only tags of the object" ), PARSE_OPT_LASTARG_DEFAULT ,
@@ -486,7 +486,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
486
486
487
487
setup_ref_filter_porcelain_msg ();
488
488
489
- git_config (git_tag_config , sorting_tail );
489
+ git_config (git_tag_config , & sorting_options );
490
490
491
491
memset (& opt , 0 , sizeof (opt ));
492
492
memset (& filter , 0 , sizeof (filter ));
@@ -525,8 +525,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
525
525
die (_ ("--column and -n are incompatible" ));
526
526
colopts = 0 ;
527
527
}
528
- if (!sorting )
529
- sorting = ref_default_sorting ();
528
+ sorting = ref_sorting_options (& sorting_options );
530
529
ref_sorting_set_sort_flags_all (sorting , REF_SORTING_ICASE , icase );
531
530
filter .ignore_case = icase ;
532
531
if (cmdmode == 'l' ) {
0 commit comments