##// END OF EJS Templates
git: simplify dangling commit checking to only full SHAs, otherwise we do too many checks in case of references which is slow on large repos
marcink -
r767:406ae170 default
parent child Browse files
Show More
@@ -692,10 +692,20 b' class GitRemote(RemoteBase):'
692 commit = repo.get(commit.target)
692 commit = repo.get(commit.target)
693 is_tag = True
693 is_tag = True
694
694
695 if not is_tag:
695 check_dangling = True
696 if is_tag:
697 check_dangling = False
698
699 # we used a reference and it parsed means we're not having a dangling commit
700 if sha != commit.hex:
701 check_dangling = False
702
703 if check_dangling:
696 # check for dangling commit
704 # check for dangling commit
697 branches = [x for x in repo.branches.with_commit(commit.hex)]
705 for branch in repo.branches.with_commit(commit.hex):
698 if not branches:
706 if branch:
707 break
708 else:
699 raise exceptions.LookupException(None)(missing_commit_err)
709 raise exceptions.LookupException(None)(missing_commit_err)
700
710
701 commit_id = commit.hex
711 commit_id = commit.hex
General Comments 0
You need to be logged in to leave comments. Login now