From 2804211f8fbef3bb8390d4b930d71ee7662938a0 Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Wed, 27 Mar 2013 16:02:28 +0000 Subject: [PATCH] Fix web subdirectory links with gitweb gitweb, ever vigilant for the slightest transgression in URL syntax, fails to find the specified path if it is a directory and has a trailing slash, so we need to avoid adding this. Signed-off-by: Paul Eggleton --- layerindex/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/layerindex/models.py b/layerindex/models.py index 6049df5..41db181 100644 --- a/layerindex/models.py +++ b/layerindex/models.py @@ -136,7 +136,10 @@ class LayerBranch(models.Model): def _handle_url_path(self, base_url, path): if base_url: if self.vcs_subdir: - extra_path = self.vcs_subdir + '/' + path + if path: + extra_path = self.vcs_subdir + '/' + path + else: + extra_path = self.vcs_subdir else: extra_path = path url = base_url.replace('%branch%', self.branch.name)