From 97268afcc9ee0f127c73d1032592b2c495492587 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jelmer=20Vernoo=C4=B3?= Date: Sun, 20 Mar 2022 01:03:31 +0000 Subject: [PATCH] Document Repo.path. Fixes #854 --- NEWS | 3 +++ dulwich/repo.py | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 8809ca217..75dc2afa3 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,8 @@ 0.20.35 UNRELEASED + * Document the ``path`` attribute for ``Repo``. + (Jelmer Vernooij, #854) + 0.20.34 2022-03-14 * Add support for multivars in configuration. diff --git a/dulwich/repo.py b/dulwich/repo.py index 2bef7d37d..7c3c3a782 100644 --- a/dulwich/repo.py +++ b/dulwich/repo.py @@ -1049,6 +1049,12 @@ class Repo(BaseRepo): Note that a repository object may hold on to resources such as file handles for performance reasons; call .close() to free up those resources. + + Attributes: + + path (str): Path to the working copy (if it exists) or repository control + directory (if the repository is bare) + bare (bool): Whether this is a bare repository """ def __init__(self, root, object_store=None, bare=None): @@ -1175,8 +1181,8 @@ def commondir(self): For a main working tree, it is identical to controldir(). For a linked working tree, it is the control directory of the - main working tree.""" - + main working tree. + """ return self._commondir def _determine_file_mode(self):