sorbet: set utils/git.rb to true

(cherry picked from commit 44a04adb1de430066af73a65766eb644c0f5bd41)
This commit is contained in:
vidusheeamoli 2020-07-08 00:36:29 +05:30
parent e09802b8a7
commit 76a2e69990
3 changed files with 17 additions and 2 deletions

View File

@ -452,7 +452,6 @@ false:
- ./utils/curl.rb
- ./utils/fork.rb
- ./utils/formatter.rb
- ./utils/git.rb
- ./utils/github.rb
- ./utils/notability.rb
- ./utils/popen.rb
@ -890,6 +889,7 @@ true:
- ./test/support/helper/fixtures.rb
- ./test/support/lib/config.rb
- ./utils/bottles.rb
- ./utils/git.rb
- ./utils/shell.rb
- ./utils/svn.rb
- ./utils/tty.rb

View File

@ -0,0 +1,15 @@
# typed: strict
module Git
include Kernel
def last_revision_commit_of_file(repo, file, before_commit: nil)
end
sig { params(repo: Pathname, files: T::Array[Pathname], before_commit: T.nilable(String)).void }
def last_revision_commit_of_files(repo, files, before_commit: nil)
end
def last_revision_of_file(repo, file, before_commit: nil)
end
end

View File

@ -36,7 +36,7 @@ module Git
out, = Open3.capture3(
HOMEBREW_SHIMS_PATH/"scm/git", "-C", repo, "log",
"--pretty=format:%h", "--abbrev=7", "--max-count=1",
"--diff-filter=d", "--name-only", *args, "--", *files
"--diff-filter=d", "--name-only", *args, "--", files.join(" ")
)
rev, *paths = out.chomp.split(/\n/).reject(&:empty?)
[rev, paths]