return {} unless ::File.exist?(::File.join(@new_resource.destination, ".svn"))
@repo_attrs ||= svn_info.lines.each_with_object({}) do |line, attrs|
- fail "Could not parse `svn info` data: #{line}" unless line =~ SVN_INFO_PATTERN
+ raise "Could not parse `svn info` data: #{line}" unless line =~ SVN_INFO_PATTERN
property = Regexp.last_match[1]
value = Regexp.last_match[2]
# sanity check: the files we're moving into place
# should be non-empty.
- fail "Temporary gzip file should exist, but doesn't." unless File.exist?(tmp_data)
- fail "Temporary state file should exist, but doesn't." unless File.exist?(tmp_state)
- fail "Temporary gzip file should be non-empty, but isn't." if File.zero?(tmp_data)
- fail "Temporary state file should be non-empty, but isn't." if File.zero?(tmp_state)
+ raise "Temporary gzip file should exist, but doesn't." unless File.exist?(tmp_data)
+ raise "Temporary state file should exist, but doesn't." unless File.exist?(tmp_state)
+ raise "Temporary gzip file should be non-empty, but isn't." if File.zero?(tmp_data)
+ raise "Temporary state file should be non-empty, but isn't." if File.zero?(tmp_state)
FileUtils.mv(tmp_data, data_file)
FileUtils.mv(tmp_state, @config["state_file"])
ok = true
if IO.popen(["git", "ls-files", "--unmerged"]).read.empty?
- need_stash = IO.popen(%w(git diff)).read.length > 0
+ need_stash = !IO.popen(%w(git diff)).read.empty?
system("git", "stash", "save", "--keep-index", "--quiet") if need_stash