File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/env ruby
22
33require File . dirname ( __FILE__ ) + '/../test_helper'
4+ require "fileutils"
45
56# tests all the low level git communication
67#
@@ -51,8 +52,13 @@ def test_commit_with_no_verify
5152 move_file ( pre_commit_path , pre_commit_path_bak )
5253
5354 # Adds a pre-commit file that should throw an error
54- create_file ( pre_commit_path , 'echo Pre-commit file. Shoud not execute; exit 1' ) # Error when executed
55- File . chmod ( 0111 , pre_commit_path )
55+ create_file ( pre_commit_path , <<~PRE_COMMIT_SCRIPT )
56+ #!/bin/sh
57+ echo "pre-commit script exits with an error"
58+ exit 1
59+ PRE_COMMIT_SCRIPT
60+
61+ FileUtils . chmod ( "+x" , pre_commit_path )
5662
5763 create_file ( "#{ @wdir } /test_file_2" , 'content test_file_2' )
5864 @lib . add ( 'test_file_2' )
You can’t perform that action at this time.
0 commit comments