diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | lib/git/commit.py | 3 | ||||
-rw-r--r-- | lib/git/tree.py | 2 | ||||
-rw-r--r-- | test/git/test_repo.py | 8 | ||||
-rw-r--r-- | test/git/test_tree.py | 8 |
5 files changed, 12 insertions, 10 deletions
@@ -4,3 +4,4 @@ /lib/GitPython.egg-info /build /dist +/doc/_build diff --git a/lib/git/commit.py b/lib/git/commit.py index 2bd78b75..ba7a7102 100644 --- a/lib/git/commit.py +++ b/lib/git/commit.py @@ -114,6 +114,7 @@ class Commit(LazyMixin): def find_all(cls, repo, ref, path='', **kwargs): """ Find all commits matching the given criteria. + ``repo`` is the Repo @@ -151,7 +152,7 @@ class Commit(LazyMixin): Returns git.Commit[] """ - lines = [l for l in text.splitlines() if l.strip()] + lines = [l for l in text.splitlines() if l.strip('\r\n')] commits = [] diff --git a/lib/git/tree.py b/lib/git/tree.py index dea10908..cfb0881c 100644 --- a/lib/git/tree.py +++ b/lib/git/tree.py @@ -45,7 +45,7 @@ class Tree(LazyMixin): ``git.Blob`` or ``git.Tree`` """ try: - mode, typ, id, name = text.expandtabs(1).split(" ", 4) + mode, typ, id, name = text.expandtabs(1).split(" ", 3) except: return None diff --git a/test/git/test_repo.py b/test/git/test_repo.py index 6b82d029..ded177d3 100644 --- a/test/git/test_repo.py +++ b/test/git/test_repo.py @@ -116,7 +116,7 @@ class TestRepo(object): @patch_object(Repo, '__init__') @patch_object(Git, '_call_process') - def test_init_bare(self, repo, git): + def test_init_bare(self, git, repo): git.return_value = True repo.return_value = None @@ -129,7 +129,7 @@ class TestRepo(object): @patch_object(Repo, '__init__') @patch_object(Git, '_call_process') - def test_init_bare_with_options(self, repo, git): + def test_init_bare_with_options(self, git, repo): git.return_value = True repo.return_value = None @@ -142,7 +142,7 @@ class TestRepo(object): @patch_object(Repo, '__init__') @patch_object(Git, '_call_process') - def test_fork_bare(self, repo, git): + def test_fork_bare(self, git, repo): git.return_value = None repo.return_value = None @@ -155,7 +155,7 @@ class TestRepo(object): @patch_object(Repo, '__init__') @patch_object(Git, '_call_process') - def test_fork_bare_with_options(self, repo, git): + def test_fork_bare_with_options(self, git, repo): git.return_value = None repo.return_value = None diff --git a/test/git/test_tree.py b/test/git/test_tree.py index c9fc2640..947b0ffb 100644 --- a/test/git/test_tree.py +++ b/test/git/test_tree.py @@ -56,7 +56,7 @@ class TestTree(object): @patch_object(Blob, 'size') @patch_object(Git, '_call_process') - def test_slash(self, blob, git): + def test_slash(self, git, blob): git.return_value = fixture('ls_tree_a') blob.return_value = 1 @@ -70,7 +70,7 @@ class TestTree(object): @patch_object(Blob, 'size') @patch_object(Git, '_call_process') - def test_slash_with_zero_length_file(self, blob, git): + def test_slash_with_zero_length_file(self, git, blob): git.return_value = fixture('ls_tree_a') blob.return_value = 0 @@ -97,7 +97,7 @@ class TestTree(object): @patch_object(Blob, 'size') @patch_object(Git, '_call_process') - def test_dict(self, blob, git): + def test_dict(self, git, blob): git.return_value = fixture('ls_tree_a') blob.return_value = 1 @@ -111,7 +111,7 @@ class TestTree(object): @patch_object(Blob, 'size') @patch_object(Git, '_call_process') - def test_dict_with_zero_length_file(self, blob, git): + def test_dict_with_zero_length_file(self, git, blob): git.return_value = fixture('ls_tree_a') blob.return_value = 0 |