aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bundler/source
diff options
context:
space:
mode:
authorJames Wen <jrw2175@columbia.edu>2016-04-03 00:28:20 -0400
committerJames Wen <jrw2175@columbia.edu>2016-04-03 23:48:17 -0400
commit29f48c3d47ed51d1c5de955eb7b7ae773a18abbb (patch)
tree04d992541fba53ec0c8e73310a8acc1c3b10208d /lib/bundler/source
parenta1ec005000359d8bb2638230e6231bf72a48d784 (diff)
downloadbundler-29f48c3d47ed51d1c5de955eb7b7ae773a18abbb.tar.gz
Remove authentication credentials for git sources from printed `bundle install` output
- Related to: bundler/bundler-features#111
Diffstat (limited to 'lib/bundler/source')
-rw-r--r--lib/bundler/source/git/git_proxy.rb14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/bundler/source/git/git_proxy.rb b/lib/bundler/source/git/git_proxy.rb
index 19e0db86..9ea7a22f 100644
--- a/lib/bundler/source/git/git_proxy.rb
+++ b/lib/bundler/source/git/git_proxy.rb
@@ -86,12 +86,12 @@ module Bundler
def checkout
if path.exist?
return if has_revision_cached?
- Bundler.ui.info "Fetching #{uri}"
+ Bundler.ui.info "Fetching #{URICredentialsFilter.anonymized_uri(uri)}"
in_path do
git_retry %(fetch --force --quiet --tags #{uri_escaped_with_configured_credentials} "refs/heads/*:refs/heads/*")
end
else
- Bundler.ui.info "Fetching #{uri}"
+ Bundler.ui.info "Fetching #{URICredentialsFilter.anonymized_uri(uri)}"
SharedHelpers.filesystem_access(path.dirname) do |p|
FileUtils.mkdir_p(p)
end
@@ -145,10 +145,14 @@ module Bundler
end
def git(command, check_errors = true, error_msg = nil)
- raise GitNotAllowedError.new(command) unless allow?
+ command_with_no_credentials = URICredentialsFilter.credentials_filtered_string(command, uri)
+ raise GitNotAllowedError.new(command_with_no_credentials) unless allow?
+
out = SharedHelpers.with_clean_git_env { `git #{command}` }
- raise GitCommandError.new(command, path, error_msg) if check_errors && !$?.success?
- out
+
+ stdout_with_no_credentials = URICredentialsFilter.credentials_filtered_string(out, uri)
+ raise GitCommandError.new(command_with_no_credentials, path, error_msg) if check_errors && !$?.success?
+ stdout_with_no_credentials
end
def has_revision_cached?