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 <paul.eggleton@linux.intel.com>
This commit is contained in:
Paul Eggleton 2013-03-27 16:02:28 +00:00
parent cd7e00bf57
commit 2804211f8f

View File

@ -136,7 +136,10 @@ class LayerBranch(models.Model):
def _handle_url_path(self, base_url, path): def _handle_url_path(self, base_url, path):
if base_url: if base_url:
if self.vcs_subdir: if self.vcs_subdir:
if path:
extra_path = self.vcs_subdir + '/' + path extra_path = self.vcs_subdir + '/' + path
else:
extra_path = self.vcs_subdir
else: else:
extra_path = path extra_path = path
url = base_url.replace('%branch%', self.branch.name) url = base_url.replace('%branch%', self.branch.name)