| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,7 +8,10 @@ | |||
| 8 | 8 | assure_directory_exists | |
| 9 | 9 | ) | |
| 10 | 10 | ||
| 11 | - from gitdb.exc import BadObject | ||
| 11 | + from gitdb.exc import ( | ||
| 12 | + BadObject, | ||
| 13 | + BadName | ||
| 14 | + ) | ||
| 12 | 15 | from gitdb.util import ( | |
| 13 | 16 | join, | |
| 14 | 17 | dirname, | |
@@ -201,7 +204,7 @@ def set_commit(self, commit, logmsg=None): | |||
| 201 | 204 | else: | |
| 202 | 205 | try: | |
| 203 | 206 | invalid_type = self.repo.rev_parse(commit).type != Commit.type | |
| 204 | - except BadObject: | ||
| 207 | + except (BadObject, BadName): | ||
| 205 | 208 | raise ValueError("Invalid object: %s" % commit) | |
| 206 | 209 | # END handle exception | |
| 207 | 210 | # END verify type | |
@@ -283,7 +286,7 @@ def set_reference(self, ref, logmsg=None): | |||
| 283 | 286 | try: | |
| 284 | 287 | obj = self.repo.rev_parse(ref + "^{}") # optionally deref tags | |
| 285 | 288 | write_value = obj.hexsha | |
| 286 | - except BadObject: | ||
| 289 | + except (BadObject, BadName): | ||
| 287 | 290 | raise ValueError("Could not extract object from %s" % ref) | |
| 288 | 291 | # END end try string | |
| 289 | 292 | else: | |
| Back | FazBrowse Home | New Git URL |
0 commit comments