More refactoring

This commit is contained in:
Sven Weidauer 2022-05-29 09:45:13 +02:00
parent d933f690d4
commit 5f8af000ee

View file

@ -61,18 +61,21 @@ class FormatStaged
end
replace_file_in_index file, new_hash
if update
begin
patch_working_file file, new_hash
rescue StandardError => e
warning "failed updating #{file.src_path} in working copy: #{e}"
end
end
update_working_copy file, new_hash
true
end
def update_working_copy(file, new_hash)
return unless update
begin
patch_working_file file, new_hash
rescue StandardError => e
warning "failed updating #{file.src_path} in working copy: #{e}"
end
end
def format_object(file)
info "Formatting #{file.src_path}"