@@ -344,12 +344,13 @@ static void read_branches(void)
344
344
345
345
struct ref_states {
346
346
struct remote * remote ;
347
- struct string_list new_refs , stale , tracked , heads , push ;
347
+ struct string_list new_refs , skipped , stale , tracked , heads , push ;
348
348
int queried ;
349
349
};
350
350
351
351
#define REF_STATES_INIT { \
352
352
.new_refs = STRING_LIST_INIT_DUP, \
353
+ .skipped = STRING_LIST_INIT_DUP, \
353
354
.stale = STRING_LIST_INIT_DUP, \
354
355
.tracked = STRING_LIST_INIT_DUP, \
355
356
.heads = STRING_LIST_INIT_DUP, \
@@ -368,7 +369,9 @@ static int get_ref_states(const struct ref *remote_refs, struct ref_states *stat
368
369
states -> remote -> fetch .raw [i ]);
369
370
370
371
for (ref = fetch_map ; ref ; ref = ref -> next ) {
371
- if (!ref -> peer_ref || !ref_exists (ref -> peer_ref -> name ))
372
+ if (omit_name_by_refspec (ref -> name , & states -> remote -> fetch ))
373
+ string_list_append (& states -> skipped , abbrev_branch (ref -> name ));
374
+ else if (!ref -> peer_ref || !ref_exists (ref -> peer_ref -> name ))
372
375
string_list_append (& states -> new_refs , abbrev_branch (ref -> name ));
373
376
else
374
377
string_list_append (& states -> tracked , abbrev_branch (ref -> name ));
@@ -383,6 +386,7 @@ static int get_ref_states(const struct ref *remote_refs, struct ref_states *stat
383
386
free_refs (fetch_map );
384
387
385
388
string_list_sort (& states -> new_refs );
389
+ string_list_sort (& states -> skipped );
386
390
string_list_sort (& states -> tracked );
387
391
string_list_sort (& states -> stale );
388
392
@@ -941,6 +945,7 @@ static void clear_push_info(void *util, const char *string)
941
945
static void free_remote_ref_states (struct ref_states * states )
942
946
{
943
947
string_list_clear (& states -> new_refs , 0 );
948
+ string_list_clear (& states -> skipped , 0 );
944
949
string_list_clear (& states -> stale , 1 );
945
950
string_list_clear (& states -> tracked , 0 );
946
951
string_list_clear (& states -> heads , 0 );
@@ -1035,6 +1040,8 @@ static int show_remote_info_item(struct string_list_item *item, void *cb_data)
1035
1040
arg = states -> remote -> name ;
1036
1041
} else if (string_list_has_string (& states -> tracked , name ))
1037
1042
arg = _ (" tracked" );
1043
+ else if (string_list_has_string (& states -> skipped , name ))
1044
+ arg = _ (" skipped" );
1038
1045
else if (string_list_has_string (& states -> stale , name ))
1039
1046
arg = _ (" stale (use 'git remote prune' to remove)" );
1040
1047
else
@@ -1308,6 +1315,7 @@ static int show(int argc, const char **argv)
1308
1315
/* remote branch info */
1309
1316
info .width = 0 ;
1310
1317
for_each_string_list (& info .states .new_refs , add_remote_to_show_info , & info );
1318
+ for_each_string_list (& info .states .skipped , add_remote_to_show_info , & info );
1311
1319
for_each_string_list (& info .states .tracked , add_remote_to_show_info , & info );
1312
1320
for_each_string_list (& info .states .stale , add_remote_to_show_info , & info );
1313
1321
if (info .list .nr )
0 commit comments