From 3cb5ba18ab1a875ef6b62c65342de476be47871b Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Tue, 3 Nov 2009 16:35:33 +0100 Subject: object: renamed id attribute to sha as it in fact is always being rewritten as sha, even if the passed in id was a ref. This is done to assure objects are uniquely identified and will compare correctly --- lib/git/refs.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/git/refs.py') diff --git a/lib/git/refs.py b/lib/git/refs.py index ddf98fc7..84347057 100644 --- a/lib/git/refs.py +++ b/lib/git/refs.py @@ -312,17 +312,17 @@ class SymbolicReference(object): if isinstance(ref, Head): write_value = "ref: %s" % ref.path elif isinstance(ref, Commit): - write_value = ref.id + write_value = ref.sha else: try: - write_value = ref.commit.id + write_value = ref.commit.sha except AttributeError: sha = str(ref) try: obj = Object.new(self.repo, sha) if obj.type != "commit": raise TypeError("Invalid object type behind sha: %s" % sha) - write_value = obj.id + write_value = obj.sha except Exception: raise ValueError("Could not extract object from %s" % ref) # END end try string @@ -428,7 +428,7 @@ class Head(Reference): >>> head.commit - >>> head.commit.id + >>> head.commit.sha '1c09f116cbc2cb4100fb6935bb162daa4723f455' """ _common_path_default = "refs/heads" -- cgit v1.2.1