diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2015-01-20 20:56:33 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2015-01-20 20:56:33 +0100 |
commit | 9fbae711b76a4f2fa9345f43da6d2cdedd75d6c3 (patch) | |
tree | e203a3ea4ab21dc4db72e7df3ec52237e7cd65ae /git/exc.py | |
parent | ea29541e213df928d356b3c12d4d074001395d3c (diff) | |
download | gitpython-9fbae711b76a4f2fa9345f43da6d2cdedd75d6c3.tar.gz |
Greatly improved possible safety of Submodule.update(), which is used by default.
Previously, the implementation would gladly reset new commits in submodules,
and/or reset a dirty working tree.
Now the new force_reset/force flag has to be specified explicitly to get back
to the old behaviour.
All submodule tests except for one are working.
Diffstat (limited to 'git/exc.py')
-rw-r--r-- | git/exc.py | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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) |