From e56ab370a7803067b2f230fceb53ebf4d46a580f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Sun, 13 Apr 2014 18:57:03 +0200 Subject: [PATCH] Remote: make sure to take the contents of the id Pass the contents of the buffer containing the git_oid to bytes() so build a raw representation of its contents. Using bytes(ffi.buffer(...)) returns the representation of the buffer. --- pygit2/remote.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pygit2/remote.py b/pygit2/remote.py index 07614d3..6a2a7b9 100644 --- a/pygit2/remote.py +++ b/pygit2/remote.py @@ -334,8 +334,8 @@ class Remote(object): try: s = maybe_string(refname) - a = Oid(raw=bytes(ffi.buffer(a))) - b = Oid(raw=bytes(ffi.buffer(b))) + a = Oid(raw=bytes(ffi.buffer(a)[:])) + b = Oid(raw=bytes(ffi.buffer(b)[:])) self.update_tips(s, a, b) except Exception as e: