From 038e35cb3d40f85b35b6fbe0807f9c761c474310 Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 15:55:42 +0800 Subject: [PATCH] Update GitTree --- github/GitCommit.py | 14 +++++++++++++- github/GitTree.py | 3 --- github/Repository.py | 4 ++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/github/GitCommit.py b/github/GitCommit.py index e9272bdc..ab012fba 100644 --- a/github/GitCommit.py +++ b/github/GitCommit.py @@ -124,7 +124,19 @@ class GitCommit(github.GithubObject.CompletableGithubObject): self._sha = attributes["sha"] if "tree" in attributes: # pragma no branch assert attributes["tree"] is None or isinstance(attributes["tree"], dict), attributes["tree"] - self._tree = None if attributes["tree"] is None else github.GitTree.GitTree(self._requester, attributes["tree"], completed=False) + self._tree = None if attributes["tree"] is None else github.GitTree.GitTree(self._requester, self._headers, attributes["tree"], completed=False) if "url" in attributes: # pragma no branch assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] self._url = attributes["url"] + + + + + + + + + + + + diff --git a/github/GitTree.py b/github/GitTree.py index 741180f2..f999de89 100644 --- a/github/GitTree.py +++ b/github/GitTree.py @@ -32,9 +32,6 @@ class GitTree(github.GithubObject.CompletableGithubObject): """ This class represents GitTrees as returned for example by http://developer.github.com/v3/todo """ - def __init__(self, requester, attributes, completed): - # Adapte for __init__ change, remove later - github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def sha(self): diff --git a/github/Repository.py b/github/Repository.py index c9757d5e..e733d891 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -494,7 +494,7 @@ class Repository(github.GithubObject.CompletableGithubObject): None, post_parameters ) - return github.GitTree.GitTree(self._requester, data, completed=True) + return github.GitTree.GitTree(self._requester, headers, data, completed=True) def create_hook(self, name, config, events=github.GithubObject.NotSet, active=github.GithubObject.NotSet): """ @@ -1079,7 +1079,7 @@ class Repository(github.GithubObject.CompletableGithubObject): url_parameters, None ) - return github.GitTree.GitTree(self._requester, data, completed=True) + return github.GitTree.GitTree(self._requester, headers, data, completed=True) def get_hook(self, id): """