lib/gitlab/shell_history.rb in gitlab-4.11.0 vs lib/gitlab/shell_history.rb in gitlab-4.12.0
- old
+ new
@@ -28,15 +28,11 @@
end
private
def history_file
- if defined?(@history_file)
- @history_file
- else
- @history_file = File.open(history_file_path, 'w', 0o600).tap do |file|
- file.sync = true
- end
+ @history_file ||= File.open(history_file_path, 'w', 0o600).tap do |file|
+ file.sync = true
end
rescue Errno::EACCES
warn 'History not saved; unable to open your history file for writing.'
@history_file = false
end