##// END OF EJS Templates
git: don not verify dangling commit branch assignment for tags
marcink -
r747:9c2265ca default
parent child Browse files
Show More
@@ -679,7 +679,6 b' class GitRemote(object):'
679
679
680 @reraise_safe_exceptions
680 @reraise_safe_exceptions
681 def get_object(self, wire, sha):
681 def get_object(self, wire, sha):
682
683 cache_on, context_uid, repo_id = self._cache_on(wire)
682 cache_on, context_uid, repo_id = self._cache_on(wire)
684 @self.region.conditional_cache_on_arguments(condition=cache_on)
683 @self.region.conditional_cache_on_arguments(condition=cache_on)
685 def _get_object(_context_uid, _repo_id, _sha):
684 def _get_object(_context_uid, _repo_id, _sha):
@@ -692,13 +691,16 b' class GitRemote(object):'
692 except (KeyError, ValueError) as e:
691 except (KeyError, ValueError) as e:
693 raise exceptions.LookupException(e)(missing_commit_err)
692 raise exceptions.LookupException(e)(missing_commit_err)
694
693
694 is_tag = False
695 if isinstance(commit, pygit2.Tag):
695 if isinstance(commit, pygit2.Tag):
696 commit = repo.get(commit.target)
696 commit = repo.get(commit.target)
697 is_tag = True
697
698
698 # check for dangling commit
699 if not is_tag:
699 branches = [x for x in repo.branches.with_commit(commit.hex)]
700 # check for dangling commit
700 if not branches:
701 branches = [x for x in repo.branches.with_commit(commit.hex)]
701 raise exceptions.LookupException(None)(missing_commit_err)
702 if not branches:
703 raise exceptions.LookupException(None)(missing_commit_err)
702
704
703 commit_id = commit.hex
705 commit_id = commit.hex
704 type_id = commit.type
706 type_id = commit.type
General Comments 0
You need to be logged in to leave comments. Login now