From 2ba897b12024fd20681b7c2f1b40bdbbccd5df59 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Sun, 11 Sep 2016 17:40:44 +0200 Subject: fix(repo): make it serializable with pickle It's entirely untested if this repo still does the right thing, but I'd think it does. Fixes #504 --- git/test/test_repo.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'git/test/test_repo.py') diff --git a/git/test/test_repo.py b/git/test/test_repo.py index 17e990f9..e24062c1 100644 --- a/git/test/test_repo.py +++ b/git/test/test_repo.py @@ -4,6 +4,8 @@ # # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php +import pickle + from git.test.lib import ( patch, TestBase, @@ -104,13 +106,15 @@ class TestRepo(TestBase): # try from invalid revision that does not exist self.failUnlessRaises(BadName, self.rorepo.tree, 'hello world') + + def test_pickleable(self): + pickle.loads(pickle.dumps(self.rorepo)) def test_commit_from_revision(self): commit = self.rorepo.commit('0.1.4') assert commit.type == 'commit' assert self.rorepo.commit(commit) == commit - def test_commits(self): mc = 10 commits = list(self.rorepo.iter_commits('0.1.6', max_count=mc)) assert len(commits) == mc -- cgit v1.2.1