Skip to content
Snippets Groups Projects
Commit 6bf8f8b3 authored by Siddharth Agarwal's avatar Siddharth Agarwal
Browse files

git_handler.get_git_incoming: explicitly use the Git object store

This is preparation for moving most of the code here out into a separate
module. With this patch, we can avoid passing in the entire Repo object and
just pass in the object store to the factored out function.
parent 3c3a6505
No related branches found
No related tags found
No related merge requests found
......@@ -663,6 +663,8 @@
def get_git_incoming(self, refs):
if refs is None:
refs = self.git.refs.as_dict()
git_object_store = self.git.object_store
# import heads and fetched tags as remote references
todo = []
done = set()
......@@ -674,7 +676,7 @@
for sha in refs.itervalues():
# refs contains all the refs in the server, not just the ones
# we are pulling
if sha in self.git.object_store:
obj = self.git.get_object(sha)
if sha in git_object_store:
obj = git_object_store[sha]
while isinstance(obj, Tag):
obj_type, sha = obj.object
......@@ -679,9 +681,9 @@
while isinstance(obj, Tag):
obj_type, sha = obj.object
obj = self.git.get_object(sha)
obj = git_object_store[sha]
if isinstance (obj, Commit) and sha not in seenheads:
seenheads.add(sha)
todo.append(sha)
# sort by commit date
def commitdate(sha):
......@@ -682,10 +684,10 @@
if isinstance (obj, Commit) and sha not in seenheads:
seenheads.add(sha)
todo.append(sha)
# sort by commit date
def commitdate(sha):
obj = self.git.get_object(sha)
obj = git_object_store[sha]
return obj.commit_time-obj.commit_timezone
todo.sort(key=commitdate, reverse=True)
......@@ -703,7 +705,7 @@
if sha in commit_cache:
obj = commit_cache[sha]
else:
obj = self.git.get_object(sha)
obj = git_object_store[sha]
commit_cache[sha] = obj
assert isinstance(obj, Commit)
for p in obj.parents:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment