aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/cgit
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--cgitize/cgit.py2
-rw-r--r--cgitize/repo.py17
2 files changed, 15 insertions, 4 deletions
diff --git a/cgitize/cgit.py b/cgitize/cgit.py
index dd06216..e2e872e 100644
--- a/cgitize/cgit.py
+++ b/cgitize/cgit.py
@@ -18,7 +18,7 @@ class CGitServer:
def get_clone_url(self, repo):
if self.clone_url is None:
return None
- return self.clone_url.format(repo=repo.dir)
+ return self.clone_url.format(repo=repo.url_path)
class CGitRCWriter:
diff --git a/cgitize/repo.py b/cgitize/repo.py
index 079801f..dd55b17 100644
--- a/cgitize/repo.py
+++ b/cgitize/repo.py
@@ -93,6 +93,10 @@ class Repo:
return self._name
@property
+ def namegit(self):
+ return f'{self.name}.git'
+
+ @property
def desc(self):
if self._desc is not None and self._desc:
return self._desc
@@ -124,8 +128,15 @@ class Repo:
return self.clone_url
return url_replace_auth(self.clone_url, self.url_auth)
+ def _with_dir(self, s):
+ if self._dir is None:
+ return s
+ return os.path.join(self._dir, s)
+
@property
def dir(self):
- if self._dir is None:
- return self.name
- return os.path.join(self._dir, self.name)
+ return self._with_dir(self.namegit)
+
+ @property
+ def url_path(self):
+ return self._with_dir(self.name)