]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'jc/heads-are-branches'
authorJunio C Hamano <gitster@pobox.com>
Thu, 20 Jun 2024 22:45:16 +0000 (15:45 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 20 Jun 2024 22:45:17 +0000 (15:45 -0700)
The "--heads" option of "ls-remote" and "show-ref" has been been
deprecated; "--branches" replaces "--heads".

* jc/heads-are-branches:
  show-ref: introduce --branches and deprecate --heads
  ls-remote: introduce --branches and deprecate --heads
  refs: call branches branches

1  2 
builtin/show-ref.c
remote.h

index 3114bdc391aa925ee354d85eaf33052ef96af0b8,f634bc3e443956111c209e6fdc32ce91fddb1242..839a5c29f31439e104ef99daf3460709e3e45909
@@@ -206,20 -205,14 +206,20 @@@ static int cmd_show_ref__patterns(cons
                show_ref_data.patterns = patterns;
  
        if (opts->show_head)
 -              head_ref(show_ref, &show_ref_data);
 +              refs_head_ref(get_main_ref_store(the_repository), show_ref,
 +                            &show_ref_data);
-       if (opts->heads_only || opts->tags_only) {
-               if (opts->heads_only)
+       if (opts->branches_only || opts->tags_only) {
+               if (opts->branches_only)
 -                      for_each_fullref_in("refs/heads/", show_ref, &show_ref_data);
 +                      refs_for_each_fullref_in(get_main_ref_store(the_repository),
 +                                               "refs/heads/", NULL,
 +                                               show_ref, &show_ref_data);
                if (opts->tags_only)
 -                      for_each_fullref_in("refs/tags/", show_ref, &show_ref_data);
 +                      refs_for_each_fullref_in(get_main_ref_store(the_repository),
 +                                               "refs/tags/", NULL, show_ref,
 +                                               &show_ref_data);
        } else {
 -              for_each_ref(show_ref, &show_ref_data);
 +              refs_for_each_ref(get_main_ref_store(the_repository),
 +                                show_ref, &show_ref_data);
        }
        if (!show_ref_data.found_match)
                return 1;
diff --cc remote.h
Simple merge