summaryrefslogtreecommitdiff
path: root/test/git/test_commit.py
diff options
context:
space:
mode:
authorPaul Sowden <paul@idontsmoke.co.uk>2008-11-20 00:09:43 -0800
committerMichael Trier <mtrier@gmail.com>2008-12-15 14:12:23 -0500
commit753e908dcea03cf9962cf45d3965cf93b0d30d94 (patch)
tree409595f1b5368461b5afc7ee0db642c6a83fd538 /test/git/test_commit.py
parent9e14356d12226cb140b0e070bd079468b4ab599b (diff)
downloadgitpython-753e908dcea03cf9962cf45d3965cf93b0d30d94.tar.gz
implement a far far faster diff parser
The old diff parser in list_from_string took a large amount of time to parse long diffs, on one of my repositories it took over 3 minutes to parse the initial commit. The new parser uses a single regexp to match the header of a diff, and iterates over the each individual diff by splitting the entire string by the diff seperator, attempting to match the header for each individual diff. With the new parser parsing the same repository is almost instant, woohoo! (cherry picked from commit 5b6b27f153bdc30380bea12a528ef483571dd57a)
Diffstat (limited to 'test/git/test_commit.py')
-rw-r--r--test/git/test_commit.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/git/test_commit.py b/test/git/test_commit.py
index f6e34dac..93c7d2c2 100644
--- a/test/git/test_commit.py
+++ b/test/git/test_commit.py
@@ -130,7 +130,7 @@ class TestCommit(object):
assert_equal('History.txt', diffs[0].a_path)
assert_equal('History.txt', diffs[0].b_path)
assert_equal(None, diffs[0].a_commit)
- assert_equal(None, diffs[0].b_mode)
+ assert_equal('100644', diffs[0].b_mode)
assert_equal('81d2c27608b352814cbe979a6acd678d30219678', diffs[0].b_commit.id)
assert_equal(True, diffs[0].new_file)
assert_equal(False, diffs[0].deleted_file)