From: Junio C Hamano Date: Thu, 20 Jun 2024 22:45:16 +0000 (-0700) Subject: Merge branch 'jc/heads-are-branches' X-Git-Tag: v2.46.0-rc0~38 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=892fd8b89fc62e2b400d7165700e67343f7a1c92;p=thirdparty%2Fgit.git Merge branch 'jc/heads-are-branches' 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 --- 892fd8b89fc62e2b400d7165700e67343f7a1c92 diff --cc builtin/show-ref.c index 3114bdc391,f634bc3e44..839a5c29f3 --- a/builtin/show-ref.c +++ b/builtin/show-ref.c @@@ -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;