Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1531d78

Browse files
committed
Now finally, tests should be working on travis too.
Now handling the new exception BadName as well
1 parent 1d52f98 commit 1531d78

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

git/refs/symbolic.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
assure_directory_exists
99
)
1010

11-
from gitdb.exc import BadObject
11+
from gitdb.exc import (
12+
BadObject,
13+
BadName
14+
)
1215
from gitdb.util import (
1316
join,
1417
dirname,
@@ -201,7 +204,7 @@ def set_commit(self, commit, logmsg=None):
201204
else:
202205
try:
203206
invalid_type = self.repo.rev_parse(commit).type != Commit.type
204-
except BadObject:
207+
except (BadObject, BadName):
205208
raise ValueError("Invalid object: %s" % commit)
206209
# END handle exception
207210
# END verify type
@@ -283,7 +286,7 @@ def set_reference(self, ref, logmsg=None):
283286
try:
284287
obj = self.repo.rev_parse(ref + "^{}") # optionally deref tags
285288
write_value = obj.hexsha
286-
except BadObject:
289+
except (BadObject, BadName):
287290
raise ValueError("Could not extract object from %s" % ref)
288291
# END end try string
289292
else:

0 commit comments

Comments
 (0)