summaryrefslogtreecommitdiff
path: root/git/exc.py
diff options
context:
space:
mode:
Diffstat (limited to 'git/exc.py')
-rw-r--r--git/exc.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/git/exc.py b/git/exc.py
index d9b7cbd2..7ee6726e 100644
--- a/git/exc.py
+++ b/git/exc.py
@@ -84,3 +84,14 @@ class HookExecutionError(Exception):
def __str__(self):
return ("'%s' hook returned with exit code %i\nstdout: '%s'\nstderr: '%s'"
% (self.command, self.status, self.stdout, self.stderr))
+
+
+class RepositoryDirtyError(Exception):
+ """Thrown whenever an operation on a repository fails as it has uncommited changes that would be overwritten"""
+
+ def __init__(self, repo, message):
+ self.repo = repo
+ self.message = message
+
+ def __str__(self):
+ return "Operation cannot be performed on %r: %s" % (self.repo, self.message)