MCPcopy Index your code
hub / github.com/AI45Lab/Code / remote_git_config_to_core

Function remote_git_config_to_core

sdk/node/src/lib.rs:2200–2224  ·  view source on GitHub ↗
(
    js: &JsRemoteGitBackendConfig,
)

Source from the content-addressed store, hash-verified

2198}
2199
2200fn remote_git_config_to_core(
2201 js: &JsRemoteGitBackendConfig,
2202) -> a3s_code_core::RemoteGitBackendConfig {
2203 let mut cfg =
2204 a3s_code_core::RemoteGitBackendConfig::new(js.base_url.clone(), js.repo_id.clone());
2205 if let Some(ref t) = js.bearer_token {
2206 cfg = cfg.bearer_token(t.clone());
2207 }
2208 if let Some(ref p) = js.client_cert_pem {
2209 cfg = cfg.client_cert_pem(std::path::PathBuf::from(p));
2210 }
2211 if let Some(ref p) = js.client_key_pem {
2212 cfg = cfg.client_key_pem(std::path::PathBuf::from(p));
2213 }
2214 if let Some(ms) = js.request_timeout_ms {
2215 cfg = cfg.request_timeout(std::time::Duration::from_millis(ms.max(0) as u64));
2216 }
2217 if let Some(n) = js.max_diff_bytes {
2218 cfg = cfg.max_diff_bytes(n.max(0) as u64);
2219 }
2220 if let Some(n) = js.max_log_entries {
2221 cfg = cfg.max_log_entries(n.max(0) as usize);
2222 }
2223 cfg
2224}
2225
2226fn js_optional_usize(
2227 value: Option<f64>,

Callers 1

Calls 7

bearer_tokenMethod · 0.80
client_cert_pemMethod · 0.80
client_key_pemMethod · 0.80
max_diff_bytesMethod · 0.80
max_log_entriesMethod · 0.80
cloneMethod · 0.45
request_timeoutMethod · 0.45

Tested by

no test coverage detected