python-pygit2/0002-repository-decode-linkname.patch
Igor Gnatenko 518e56814d Remove remote-calling unit tests
Changelog:
- Remove remote-calling unit tests
- repository: decode() linkname
- repository: SYMTYPE is constant in module tarfile, not in any class
2016-04-18 09:24:38 +02:00

27 lines
1.1 KiB
Diff

From 7d296f33e67f53783856c045a7f21a9df75dd91e Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenko@redhat.com>
Date: Fri, 15 Apr 2016 14:13:47 +0200
Subject: [PATCH] repository: decode() linkname
Reference: https://github.com/libgit2/pygit2/issues/620
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
(cherry picked from commit fd9a39a91b11964b8b88fdb4caf51ffdc559a6fa)
---
pygit2/repository.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/pygit2/repository.py b/pygit2/repository.py
index 88cc888..4cf1a80 100644
--- a/pygit2/repository.py
+++ b/pygit2/repository.py
@@ -800,7 +800,8 @@ class Repository(_Repository):
info.uname = info.gname = 'root' # just because git does this
if entry.mode == GIT_FILEMODE_LINK:
info.type = tarfile.SYMTYPE
- info.linkname = content
+ info.type = archive.SYMTYPE
+ info.linkname = content.decode("utf-8")
info.mode = 0o777 # symlinks get placeholder
info.size = 0
archive.addfile(info)