Merge pull request #3912 from stek29/git-log-format

utils/git: use exact format for last_revision_*
This commit is contained in:
Mike McQuaid 2018-03-12 11:39:39 +00:00 committed by GitHub
commit 144356e238
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,9 +8,10 @@ module Git
out, = Open3.capture3(
HOMEBREW_SHIMS_PATH/"scm/git", "-C", repo,
"log", "--oneline", "--max-count=1", *args, "--", file
"log", "--format=%h", "--abbrev=7", "--max-count=1",
*args, "--", file
)
out.split(" ").first
out.chomp
end
def last_revision_of_file(repo, file, before_commit: nil)