diff options
Diffstat (limited to 'git/test/test_repo.py')
-rw-r--r-- | git/test/test_repo.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/git/test/test_repo.py b/git/test/test_repo.py index 7ccd173e..17e990f9 100644 --- a/git/test/test_repo.py +++ b/git/test/test_repo.py @@ -325,7 +325,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] @@ -793,12 +793,23 @@ class TestRepo(TestBase): new_file_path = os.path.join(rw_dir, "new_file.ext") touch(new_file_path) r.index.add([new_file_path]) - r.index.commit("initial commit") + r.index.commit("initial commit\nBAD MESSAGE 1\n") # Now a branch should be creatable nb = r.create_head('foo') assert nb.is_valid() + with open(new_file_path, 'w') as f: + f.write('Line 1\n') + + r.index.add([new_file_path]) + r.index.commit("add line 1\nBAD MESSAGE 2\n") + + with open('%s/.git/logs/refs/heads/master' % (rw_dir,), 'r') as f: + contents = f.read() + + assert 'BAD MESSAGE' not in contents, 'log is corrupt' + def test_merge_base(self): repo = self.rorepo c1 = 'f6aa8d1' |