- if (skip_prefix(arg, "--branches=", &arg)) {
- for_each_glob_ref_in(show_reference, arg,
- "refs/heads/", NULL);
- clear_ref_exclusion(&ref_excludes);
- continue;
- }
- if (!strcmp(arg, "--branches")) {
- for_each_branch_ref(show_reference, NULL);
- clear_ref_exclusion(&ref_excludes);
- continue;
- }
- if (skip_prefix(arg, "--tags=", &arg)) {
- for_each_glob_ref_in(show_reference, arg,
- "refs/tags/", NULL);
- clear_ref_exclusion(&ref_excludes);
+ if (opt_with_value(arg, "--branches", &arg)) {
+ handle_ref_opt(arg, "refs/heads/");