Skip to content

Commit a32a6bc

Browse files
committed
Refs now use object.new_from_sha where possible, preventing git-batch-check to be started up for sha resolution
1 parent 1c6d783 commit a32a6bc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/git/refs.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def _set_reference(self, ref):
210210
except AttributeError:
211211
sha = str(ref)
212212
try:
213-
obj = Object.new(self.repo, sha)
213+
obj = Object.new_from_sha(self.repo, hex_to_bin(sha))
214214
if obj.type != "commit":
215215
raise TypeError("Invalid object type behind sha: %s" % sha)
216216
write_value = obj.hexsha
@@ -536,7 +536,7 @@ def _get_object(self):
536536
always point to the actual object as it gets re-created on each query"""
537537
# have to be dynamic here as we may be a tag which can point to anything
538538
# Our path will be resolved to the hexsha which will be used accordingly
539-
return Object.new(self.repo, self.path)
539+
return Object.new_from_sha(self.repo, hex_to_bin(self.dereference_recursive(self.repo, self.path)))
540540

541541
def _set_object(self, ref):
542542
"""

0 commit comments

Comments
 (0)