1111
1212static const char * const show_ref_usage [] = {
1313 N_ ("git show-ref [--head] [-d | --dereference]\n"
14- " [-s | --hash[=<n>]] [--abbrev[=<n>]] [--tags]\n"
15- " [--heads] [-- ] [<pattern>...]" ),
14+ " [-s | --hash[=<n>]] [--abbrev[=<n>]] [--branches] [-- tags]\n"
15+ " [--] [<pattern>...]" ),
1616 N_ ("git show-ref --verify [-q | --quiet] [-d | --dereference]\n"
1717 " [-s | --hash[=<n>]] [--abbrev[=<n>]]\n"
1818 " [--] [<ref>...]" ),
@@ -189,7 +189,7 @@ static int cmd_show_ref__verify(const struct show_one_options *show_one_opts,
189189
190190struct patterns_options {
191191 int show_head ;
192- int heads_only ;
192+ int branches_only ;
193193 int tags_only ;
194194};
195195
@@ -208,8 +208,8 @@ static int cmd_show_ref__patterns(const struct patterns_options *opts,
208208 if (opts -> show_head )
209209 refs_head_ref (get_main_ref_store (the_repository ), show_ref ,
210210 & show_ref_data );
211- if (opts -> heads_only || opts -> tags_only ) {
212- if (opts -> heads_only )
211+ if (opts -> branches_only || opts -> tags_only ) {
212+ if (opts -> branches_only )
213213 refs_for_each_fullref_in (get_main_ref_store (the_repository ),
214214 "refs/heads/" , NULL ,
215215 show_ref , & show_ref_data );
@@ -293,8 +293,10 @@ int cmd_show_ref(int argc, const char **argv, const char *prefix)
293293 struct show_one_options show_one_opts = {0 };
294294 int verify = 0 , exists = 0 ;
295295 const struct option show_ref_options [] = {
296- OPT_BOOL (0 , "tags" , & patterns_opts .tags_only , N_ ("only show tags (can be combined with heads)" )),
297- OPT_BOOL (0 , "heads" , & patterns_opts .heads_only , N_ ("only show heads (can be combined with tags)" )),
296+ OPT_BOOL (0 , "tags" , & patterns_opts .tags_only , N_ ("only show tags (can be combined with branches)" )),
297+ OPT_BOOL (0 , "branches" , & patterns_opts .branches_only , N_ ("only show branches (can be combined with tags)" )),
298+ OPT_HIDDEN_BOOL (0 , "heads" , & patterns_opts .branches_only ,
299+ N_ ("deprecated synonym for --branches" )),
298300 OPT_BOOL (0 , "exists" , & exists , N_ ("check for reference existence without resolving" )),
299301 OPT_BOOL (0 , "verify" , & verify , N_ ("stricter reference checking, "
300302 "requires exact ref path" )),
0 commit comments