File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -199,6 +199,9 @@ def hash_content(content)
199
199
#
200
200
def content_from_redmine_side ( file )
201
201
File . read ( file )
202
+ rescue Errno ::ENOENT => e
203
+ logger . error ( e . message )
204
+ ''
202
205
end
203
206
204
207
Original file line number Diff line number Diff line change @@ -112,7 +112,14 @@ def file_exists?
112
112
113
113
def install_hook_file
114
114
logger . info ( "Installing hook '#{ source_path } ' in '#{ destination_path } '" )
115
- RedmineGitHosting ::Commands . sudo_install_file ( File . read ( source_path ) , destination_path , filemode )
115
+ begin
116
+ content = File . read ( source_path )
117
+ rescue Errno ::ENOENT => e
118
+ logger . error ( "Errors while installing hook '#{ e . message } '" )
119
+ return false
120
+ else
121
+ RedmineGitHosting ::Commands . sudo_install_file ( content , destination_path , filemode )
122
+ end
116
123
end
117
124
118
125
You can’t perform that action at this time.
0 commit comments