From e8590424997ab1d578c777fe44bf7e4173036f93 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Sat, 29 Aug 2015 16:19:52 +0200 Subject: fix(repo): fail loudly if worktrees are used As GitPython is in maintenance mode, there will be no new features. However, I believe it's good idea to explicitly state we do not support certain things if this is the case. Therefore, when worktrees are encountered, we will throw an specific exception to indicate that. The current implementation is hacky to speed up development, and increases the risk of failing due to false-positive worktree directories. Related to #344 --- git/exc.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'git/exc.py') diff --git a/git/exc.py b/git/exc.py index f5b52374..34382ecd 100644 --- a/git/exc.py +++ b/git/exc.py @@ -14,6 +14,10 @@ class InvalidGitRepositoryError(Exception): """ Thrown if the given repository appears to have an invalid format. """ +class WorkTreeRepositoryUnsupported(InvalidGitRepositoryError): + """ Thrown to indicate we can't handle work tree repositories """ + + class NoSuchPathError(OSError): """ Thrown if a path could not be access by the system. """ -- cgit v1.2.1