Replace unless with if

Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Chris Wegrzyn 2021-05-04 11:30:14 -04:00 committed by GitHub
parent aa3e623b28
commit 84bbaf9d29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,7 +31,7 @@ class FormulaVersions
def rev_list(branch) def rev_list(branch)
repository.cd do repository.cd do
rev_list_cmd = ["git", "rev-list", "--abbrev-commit", "--remove-empty"] rev_list_cmd = ["git", "rev-list", "--abbrev-commit", "--remove-empty"]
rev_list_cmd << "--first-parent" unless repository == CoreTap.instance.path rev_list_cmd << "--first-parent" if repository != CoreTap.instance.path
Utils.popen_read(*rev_list_cmd, branch, "--", entry_name) do |io| Utils.popen_read(*rev_list_cmd, branch, "--", entry_name) do |io|
yield io.readline.chomp until io.eof? yield io.readline.chomp until io.eof?
end end