diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2015-01-08 18:09:38 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2015-01-08 18:09:38 +0100 |
commit | 1531d789df97dbf1ed3f5b0340bbf39918d9fe48 (patch) | |
tree | af25aed7b027c536ff37ec5eadcfbab8ac074d57 | |
parent | 1d52f98935b70cda4eede4d52cdad4e3b886f639 (diff) | |
download | gitpython-1531d789df97dbf1ed3f5b0340bbf39918d9fe48.tar.gz |
Now finally, tests should be working on travis too.
Now handling the new exception BadName as well
-rw-r--r-- | git/refs/symbolic.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/git/refs/symbolic.py b/git/refs/symbolic.py index cbb129d4..b5a81ee0 100644 --- a/git/refs/symbolic.py +++ b/git/refs/symbolic.py @@ -8,7 +8,10 @@ from git.util import ( assure_directory_exists ) -from gitdb.exc import BadObject +from gitdb.exc import ( + BadObject, + BadName +) from gitdb.util import ( join, dirname, @@ -201,7 +204,7 @@ class SymbolicReference(object): else: try: invalid_type = self.repo.rev_parse(commit).type != Commit.type - except BadObject: + except (BadObject, BadName): raise ValueError("Invalid object: %s" % commit) # END handle exception # END verify type @@ -283,7 +286,7 @@ class SymbolicReference(object): try: obj = self.repo.rev_parse(ref + "^{}") # optionally deref tags write_value = obj.hexsha - except BadObject: + except (BadObject, BadName): raise ValueError("Could not extract object from %s" % ref) # END end try string else: |