diff options
author | Colby Swandale <me@colby.fyi> | 2018-10-11 14:38:17 +1100 |
---|---|---|
committer | Colby Swandale <me@colby.fyi> | 2018-10-11 17:30:25 +1100 |
commit | 938938f7e5d806e14e4a4465647caf51d0a9bbaf (patch) | |
tree | 20ef2761c5f6bf1b22e9de7647d83d8e386964d9 | |
parent | 477115c0699c89a940171c4911dbc2b060054f84 (diff) | |
download | bundler-colby/fix-rubygems-spec-suite.tar.gz |
Check for file or folder when checking for git hash in build metadatacolby/fix-rubygems-spec-suite
-rw-r--r-- | lib/bundler/build_metadata.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/bundler/build_metadata.rb b/lib/bundler/build_metadata.rb index a0428f0319..c9d7482b24 100644 --- a/lib/bundler/build_metadata.rb +++ b/lib/bundler/build_metadata.rb @@ -28,7 +28,9 @@ module Bundler # If Bundler has been installed without its .git directory and without a # commit instance variable then we can't determine its commits SHA. git_dir = File.join(File.expand_path("../../..", __FILE__), ".git") - return "unknown" unless File.directory?(git_dir) + # Check for both a file or folder because RubyGems runs Bundler's test suite in a submodule + # which does not have a .git folder + return "unknown" unless File.exist?(git_dir) # Otherwise shell out to git. @git_commit_sha = Dir.chdir(File.expand_path("..", __FILE__)) do |