aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/utils')
-rw-r--r--Library/Homebrew/utils/git.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/Library/Homebrew/utils/git.rb b/Library/Homebrew/utils/git.rb
index 852192945..4fdcf1a2e 100644
--- a/Library/Homebrew/utils/git.rb
+++ b/Library/Homebrew/utils/git.rb
@@ -19,13 +19,17 @@ module Git
commit_hash = last_revision_commit_of_file(repo, relative_file, before_commit: before_commit)
out, = Open3.capture3(
HOMEBREW_SHIMS_PATH/"scm/git", "-C", repo,
- "show", "#{commit_hash}:#{file}"
+ "show", "#{commit_hash}:#{relative_file}"
)
out
end
end
module Utils
+ def self.clear_git_version_cache
+ remove_instance_variable(:@git) if instance_variable_defined?(:@git)
+ end
+
def self.git_available?
return @git if instance_variable_defined?(:@git)
@git = quiet_system HOMEBREW_SHIMS_PATH/"scm/git", "--version"