mirror of https://github.com/KLayout/klayout.git
Include proxy in Git configuration
Follows the suggestion from there: https://www.klayout.de/forum/discussion/2404. Using $KLAYOUT_GIT_HTTP_PROXY so it does not interfere with curl.
This commit is contained in:
parent
ea039bf4bb
commit
ce77909c3f
|
|
@ -27,6 +27,7 @@
|
||||||
#include "tlProgress.h"
|
#include "tlProgress.h"
|
||||||
#include "tlStaticObjects.h"
|
#include "tlStaticObjects.h"
|
||||||
#include "tlLog.h"
|
#include "tlLog.h"
|
||||||
|
#include "tlEnv.h"
|
||||||
|
|
||||||
#include <git2.h>
|
#include <git2.h>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
@ -314,6 +315,16 @@ GitObject::read (const std::string &org_url, const std::string &org_filter, cons
|
||||||
fetch_opts.callbacks.credentials = &credentials_cb;
|
fetch_opts.callbacks.credentials = &credentials_cb;
|
||||||
fetch_opts.callbacks.payload = (void *) &progress;
|
fetch_opts.callbacks.payload = (void *) &progress;
|
||||||
|
|
||||||
|
// get proxy configuration from environment variable if available
|
||||||
|
// (see https://www.klayout.de/forum/discussion/2404)
|
||||||
|
|
||||||
|
std::string http_proxy = tl::get_env ("KLAYOUT_GIT_HTTP_PROXY");
|
||||||
|
|
||||||
|
if (! http_proxy.empty ()) {
|
||||||
|
fetch_opts.proxy_opts.type = GIT_PROXY_SPECIFIED;
|
||||||
|
fetch_opts.proxy_opts.url = http_proxy.c_str ();
|
||||||
|
}
|
||||||
|
|
||||||
// build refspecs in case they are needed
|
// build refspecs in case they are needed
|
||||||
|
|
||||||
char *refs[] = { (char *) branch.c_str () };
|
char *refs[] = { (char *) branch.c_str () };
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue