File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -775,12 +775,23 @@ def test_empty_repo(self, rw_dir):
775775 new_file_path = os .path .join (rw_dir , "new_file.ext" )
776776 touch (new_file_path )
777777 r .index .add ([new_file_path ])
778- r .index .commit ("initial commit" )
778+ r .index .commit ("initial commit\n BAD MESSAGE 1 \n " )
779779
780780 # Now a branch should be creatable
781781 nb = r .create_head ('foo' )
782782 assert nb .is_valid ()
783783
784+ with open ( new_file_path , 'w' ) as f :
785+ f .write ( 'Line 1\n ' )
786+
787+ r .index .add ([new_file_path ])
788+ r .index .commit ("add line 1\n BAD MESSAGE 2\n " )
789+
790+ with open ( '%s/.git/logs/refs/heads/master' % (rw_dir ,), 'r' ) as f :
791+ contents = f .read ()
792+
793+ assert 'BAD MESSAGE' not in contents , 'log is corrupt'
794+
784795 def test_merge_base (self ):
785796 repo = self .rorepo
786797 c1 = 'f6aa8d1'
You can’t perform that action at this time.
0 commit comments