diff options
-rw-r--r-- | project.py | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1396,9 +1396,11 @@ class Project(object): | |||
1396 | 1396 | ||
1397 | if is_sha1 or tag_name is not None: | 1397 | if is_sha1 or tag_name is not None: |
1398 | try: | 1398 | try: |
1399 | self.GetRevisionId() | 1399 | # if revision (sha or tag) is not present then following function |
1400 | # throws an error. | ||
1401 | self.bare_git.rev_parse('--verify', '%s^0' % self.revisionExpr) | ||
1400 | return True | 1402 | return True |
1401 | except ManifestInvalidRevisionError: | 1403 | except GitError: |
1402 | # There is no such persistent revision. We have to fetch it. | 1404 | # There is no such persistent revision. We have to fetch it. |
1403 | pass | 1405 | pass |
1404 | 1406 | ||