lib/capybara/screenshot/diff/vcs.rb in capybara-screenshot-diff-1.8.2 vs lib/capybara/screenshot/diff/vcs.rb in capybara-screenshot-diff-1.8.3
- old
+ new
@@ -12,10 +12,14 @@
vcs_file_path = screenshot_path.relative_path_from(Screenshot.root)
redirect_target = "#{checkout_path} #{SILENCE_ERRORS}"
show_command = "git show HEAD~0:./#{vcs_file_path}"
if Screenshot.use_lfs
- `#{show_command} | git lfs smudge > #{redirect_target} ; exit ${PIPESTATUS[0]}`
+ `#{show_command} > #{checkout_path}.tmp #{SILENCE_ERRORS}`
+ if $CHILD_STATUS == 0
+ `git lfs smudge < #{checkout_path}.tmp > #{redirect_target}`
+ end
+ File.delete "#{checkout_path}.tmp"
else
`#{show_command} > #{redirect_target}`
end
if $CHILD_STATUS != 0