summaryrefslogtreecommitdiff
path: root/git/test
diff options
context:
space:
mode:
authorBarry Scott <barry@barrys-emacs.org>2016-07-29 11:33:17 +0100
committerBarry Scott <barry@barrys-emacs.org>2016-07-29 11:33:17 +0100
commit1116ef7e1bcbbc71d0b654b63156b29bfbf9afab (patch)
treecf36c9a204dde27f8e2a770be83cf5258bdb1d50 /git/test
parentb4b5ecc217154405ac0f6221af99a4ab18d067f6 (diff)
parenta4ad7cee0f8723226446a993d4f1f3b98e42583a (diff)
downloadgitpython-1116ef7e1bcbbc71d0b654b63156b29bfbf9afab.tar.gz
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'git/test')
-rw-r--r--git/test/fixtures/diff_abbrev-40_full-index_M_raw_no-color1
-rw-r--r--git/test/test_diff.py9
-rw-r--r--git/test/test_repo.py2
3 files changed, 11 insertions, 1 deletions
diff --git a/git/test/fixtures/diff_abbrev-40_full-index_M_raw_no-color b/git/test/fixtures/diff_abbrev-40_full-index_M_raw_no-color
new file mode 100644
index 00000000..dad85c68
--- /dev/null
+++ b/git/test/fixtures/diff_abbrev-40_full-index_M_raw_no-color
@@ -0,0 +1 @@
+:100644 100644 739bc65220ad90e9ebfa2d6af1723b97555569a4 0000000000000000000000000000000000000000 M README.md
diff --git a/git/test/test_diff.py b/git/test/test_diff.py
index ba0d2d13..9fdb26a2 100644
--- a/git/test/test_diff.py
+++ b/git/test/test_diff.py
@@ -104,6 +104,15 @@ class TestDiff(TestBase):
assert diff.rename_to == 'that'
assert len(list(diffs.iter_change_type('R'))) == 1
+ def test_diff_of_modified_files_not_added_to_the_index(self):
+ output = StringProcessAdapter(fixture('diff_abbrev-40_full-index_M_raw_no-color'))
+ diffs = Diff._index_from_raw_format(self.rorepo, output.stdout)
+
+ assert len(diffs) == 1, 'one modification'
+ assert len(list(diffs.iter_change_type('M'))) == 1, 'one modification'
+ assert diffs[0].change_type == 'M'
+ assert diffs[0].b_blob is None
+
def test_binary_diff(self):
for method, file_name in ((Diff._index_from_patch_format, 'diff_patch_binary'),
(Diff._index_from_raw_format, 'diff_raw_binary')):
diff --git a/git/test/test_repo.py b/git/test/test_repo.py
index fc8125fa..87887bad 100644
--- a/git/test/test_repo.py
+++ b/git/test/test_repo.py
@@ -307,7 +307,7 @@ class TestRepo(TestBase):
assert_equal('Tom Preston-Werner', c.committer.name)
assert_equal('tom@mojombo.com', c.committer.email)
assert_equal(1191997100, c.committed_date)
- assert_equal('initial grit setup', c.message)
+ self.assertRaisesRegexp(ValueError, "634396b2f541a9f2d58b00be1a07f0c358b999b3 missing", lambda: c.message)
# test the 'lines per commit' entries
tlist = b[0][1]