Quellcode durchsuchen

Document Repo.path. Fixes #854

Jelmer Vernooij vor 3 Jahren
Ursprung
Commit
97268afcc9
2 geänderte Dateien mit 11 neuen und 2 gelöschten Zeilen
  1. 3 0
      NEWS
  2. 8 2
      dulwich/repo.py

+ 3 - 0
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.

+ 8 - 2
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 @@ class Repo(BaseRepo):
         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):