summaryrefslogtreecommitdiff
path: root/src/buildtool/file_system/git_repo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/buildtool/file_system/git_repo.cpp')
-rw-r--r--src/buildtool/file_system/git_repo.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/buildtool/file_system/git_repo.cpp b/src/buildtool/file_system/git_repo.cpp
index 713c73b9..3ad5ba0c 100644
--- a/src/buildtool/file_system/git_repo.cpp
+++ b/src/buildtool/file_system/git_repo.cpp
@@ -790,10 +790,17 @@ auto GitRepo::GetCommitFromRemote(std::string const& repo_url,
// connect to remote
git_remote_callbacks callbacks{};
git_remote_init_callbacks(&callbacks, GIT_REMOTE_CALLBACKS_VERSION);
+
+ git_proxy_options proxy_opts{};
+ git_proxy_options_init(&proxy_opts, GIT_PROXY_OPTIONS_VERSION);
+
+ // set the option to auto-detect proxy settings
+ proxy_opts.type = GIT_PROXY_AUTO;
+
if (git_remote_connect(remote.get(),
GIT_DIRECTION_FETCH,
&callbacks,
- nullptr,
+ &proxy_opts,
nullptr) != 0) {
(*logger)(
fmt::format("connecting to remote {} for git repository {} "