List for cgit developers and users
 help / color / mirror / Atom feed
From: richard.maw at gmail.com (Richard Maw)
Subject: [PATCH 10/17] Find the default branch based on the contents of the namespace
Date: Sat,  2 Jul 2016 20:28:19 +0100	[thread overview]
Message-ID: <20160702192826.20385-11-richard.maw@gmail.com> (raw)
In-Reply-To: <20160702192826.20385-1-richard.maw@gmail.com>

The find_current_ref callback does not need to be modified
to strip off the namespace prefix,
since the for_each_ref functions don't include the base ref prefix.

Signed-off-by: Richard Maw <richard.maw at gmail.com>
---
 cgit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cgit.c b/cgit.c
index d9fe2b9..540200e 100644
--- a/cgit.c
+++ b/cgit.c
@@ -458,7 +458,7 @@ static char *find_default_branch(struct cgit_repo *repo)
 	info.req_ref = repo->defbranch;
 	info.first_ref = NULL;
 	info.match = 0;
-	for_each_branch_ref(find_current_ref, &info);
+	cgit_for_each_namespaced_ref_in("refs/heads/", find_current_ref, &info);
 	if (info.match)
 		ref = info.req_ref;
 	else
-- 
2.9.0



  parent reply	other threads:[~2016-07-02 19:28 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-02 19:28 [PATCH 00/17] Add support for namespaced repositories richard.maw
2016-07-02 19:28 ` [PATCH 01/17] Fix qry.head leak on error richard.maw
2016-07-11 23:05   ` Jason
2016-07-02 19:28 ` [PATCH 02/17] Fix archive generation richard.maw
2016-07-02 19:28 ` [PATCH 03/17] Add a wrapper for get_sha1 called cgit_get_sha1 richard.maw
2016-07-11 23:12   ` Jason
2016-07-12  9:16     ` richard.maw
2016-07-12  9:38       ` Jason
2016-07-02 19:28 ` [PATCH 04/17] Parse repo.namespace richard.maw
2016-07-02 19:28 ` [PATCH 05/17] Print out parsed namespace on request richard.maw
2016-07-02 19:28 ` [PATCH 06/17] Set GIT_NAMESPACE when repo.namespace is provided richard.maw
2016-07-02 19:28 ` [PATCH 07/17] Look up refs in namespace with cgit_get_sha1 richard.maw
2016-07-02 19:28 ` [PATCH 08/17] Guess the default branch based on current namespace richard.maw
2016-07-02 19:28 ` [PATCH 09/17] Add cgit_for_each_namespaced_ref_in helper richard.maw
2016-07-02 19:28 ` richard.maw [this message]
2016-07-02 19:28 ` [PATCH 11/17] Only display refs in current namespace richard.maw
2016-07-02 19:28 ` [PATCH 12/17] Add namespace support to dumb-clone richard.maw
2016-07-02 19:28 ` [PATCH 13/17] Display notes from namespace richard.maw
2016-07-02 19:28 ` [PATCH 14/17] Add documentation for repo.namespace richard.maw
2016-07-02 19:28 ` [PATCH 15/17] Allow agefile to be set per-repository richard.maw
2016-07-02 19:28 ` [PATCH 16/17] Update contrib script to update agefiles per namespace richard.maw
2016-07-02 19:28 ` [PATCH 17/17] Add documentation for repo.agefile richard.maw
2016-07-02 20:02 ` [PATCH 00/17] Add support for namespaced repositories Jason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160702192826.20385-11-richard.maw@gmail.com \
    --to=cgit@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).