Skip to content

Commit

Permalink
Pass the proxy settings to GitWorktree from GitRepository
Browse files Browse the repository at this point in the history
This commit also adds a path setting to the proxy url because
without it the url validation was failing in libgit2. It wants
at least a trailing slash.

https://bugzilla.redhat.com/show_bug.cgi?id=1735712
  • Loading branch information
carbonin committed Aug 12, 2019
1 parent f5882df commit 59f9cd2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/models/git_repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,16 @@ def worktree_params
params[:password] = auth.password
end
end
params[:proxy_url] = proxy_url if Settings.git_repository_proxy.host
params
end

def proxy_url
uri_opts = Settings.git_repository_proxy.to_h.slice(:host, :port, :scheme, :path)
uri_opts[:path] ||= "/"
URI::Generic.build(uri_opts).to_s
end

def delete_repo_dir
FileUtils.rm_rf(directory_name)
end
Expand Down
1 change: 1 addition & 0 deletions config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,7 @@
:port:
:user:
:scheme:
:path:
:help_menu:
:documentation:
:type: default
Expand Down

0 comments on commit 59f9cd2

Please sign in to comment.