From eb678253e00a730eba6c1596dd167e34f6682513 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Thu, 10 Sep 2020 14:50:37 -0400 Subject: tasks/index: prefer "HEAD" over "master" When there are no tags, we look for documentation in the hard-coded master branch. This is unlikely for git.git, but presumably triggers for translation repos. We should be more flexible and just use HEAD in this case, which will do the right thing if the translation repos switch their default branch. Note that we don't to do anything clever here like we did for the "book2" case. We're already using the commit API for the remote index, so we're free to just look up the name "HEAD". And likewise the local case is just running Git commands, so that name is fine. --- lib/tasks/index.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/tasks/index.rake b/lib/tasks/index.rake index 98a161c5..bbb0e2ad 100644 --- a/lib/tasks/index.rake +++ b/lib/tasks/index.rake @@ -304,7 +304,7 @@ def github_index_doc(index_fun, repo) tags = tags.select { |t| t.name == tagname } end else - tags=[Struct.new(:name).new("heads/master")] + tags=[Struct.new(:name).new("HEAD")] end tags.collect do |tag| # extract metadata @@ -340,7 +340,7 @@ def local_index_doc(index_fun) tags = tags.select { |t| t == tagname } end else - tags=["master"] + tags=["HEAD"] end tags.collect do |tag| # extract metadata -- cgit v1.2.3