From 1cf7e92aa310456945ae7da16f253b1331027a5b Mon Sep 17 00:00:00 2001 From: Patrick Gerard Date: Sat, 20 Aug 2022 12:37:48 +0100 Subject: [PATCH 1/3] docs: add typerror exception to active_branch method --- git/repo/base.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/git/repo/base.py b/git/repo/base.py index 5a85cc4e2..0fed0e4e0 100644 --- a/git/repo/base.py +++ b/git/repo/base.py @@ -858,6 +858,8 @@ def ignored(self, *paths: PathLike) -> List[str]: @property def active_branch(self) -> Head: """The name of the currently active branch. + + Raises: TypeError – If HEAD is detached :return: Head to the active branch""" # reveal_type(self.head.reference) # => Reference return self.head.reference From 849ca590185360713b89ad1fadb1eda2deeb4f7f Mon Sep 17 00:00:00 2001 From: Patrick Gerard Date: Sat, 20 Aug 2022 12:39:46 +0100 Subject: [PATCH 2/3] fix: sphinx syntax --- git/repo/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git/repo/base.py b/git/repo/base.py index 0fed0e4e0..a1be5ff9a 100644 --- a/git/repo/base.py +++ b/git/repo/base.py @@ -859,7 +859,7 @@ def ignored(self, *paths: PathLike) -> List[str]: def active_branch(self) -> Head: """The name of the currently active branch. - Raises: TypeError – If HEAD is detached + :raises TypeError: If HEAD is detached :return: Head to the active branch""" # reveal_type(self.head.reference) # => Reference return self.head.reference From 7dda25eafa80fc6cb2dd0a21f992205119270007 Mon Sep 17 00:00:00 2001 From: Patrick Gerard Date: Sat, 20 Aug 2022 12:37:48 +0100 Subject: [PATCH 3/3] docs: add typerror exception to active_branch method docs: add typerror exception to active_branch method fix: sphinx syntax add author --- AUTHORS | 1 + git/repo/base.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/AUTHORS b/AUTHORS index 2ac02e5fb..ef414e316 100644 --- a/AUTHORS +++ b/AUTHORS @@ -47,4 +47,5 @@ Contributors are: -Hugo van Kemenade -Hiroki Tokunaga -Julien Mauroy +-Patrick Gerard Portions derived from other open source works and are clearly marked. diff --git a/git/repo/base.py b/git/repo/base.py index 5a85cc4e2..a1be5ff9a 100644 --- a/git/repo/base.py +++ b/git/repo/base.py @@ -858,6 +858,8 @@ def ignored(self, *paths: PathLike) -> List[str]: @property def active_branch(self) -> Head: """The name of the currently active branch. + + :raises TypeError: If HEAD is detached :return: Head to the active branch""" # reveal_type(self.head.reference) # => Reference return self.head.reference