| 4687 | Original error: ${q.stderr}`};return q}async function tfK(){try{let q=await a8("ssh",["-T","-o","BatchMode=yes","-o","ConnectTimeout=2","-o","StrictHostKeyChecking=yes","git@github.com"],{timeout:3000}),K=q.code===1&&(q.stderr?.includes("successfully authenticated")||q.stdout?.includes("successfully authenticated"));return N(`SSH config check: code=${q.code} configured=${K}`),K}catch(q){return N(`SSH configuration check failed: ${d6(q)}`,{level:"warn"}),!1}}function nzY(q){return q.includes("Authentication failed")||q.includes("could not read Username")||q.includes("terminal prompts disabled")||q.includes("403")||q.includes("401")}function afK(q){return q.match(/^[^@]+@([^:]+):/)?.[1]??null}async function izY(q,K,_,z){let Y=z&&z.length>0,$=["-c","core.sshCommand=ssh -o BatchMode=yes -o StrictHostKeyChecking=yes","clone","--depth","1"];if(Y)$.push("--filter=blob:none","--no-checkout");else $.push("--recurse-submodules","--shallow-submodules");if(_)$.push("--branch",_);$.push(q,K);let A=ga();N(`git clone: url=${EH6(q)} ref=${_??"default"} timeout=${A}ms`);let O=await S7(L7(),$,{timeout:A,stdin:"ignore",env:{...process.env,...b18}}),w=EH6(q);if(q!==w){if(O.error)O.error=O.error.replaceAll(q,w);if(O.stderr)O.stderr=O.stderr.replaceAll(q,w)}if(O.code===0){if(Y){let j=await S7(L7(),["sparse-checkout","set","--cone","--",...z],{cwd:K,timeout:A,stdin:"ignore",env:{...process.env,...b18}});if(j.code!==0)return{code:j.code,stderr:`git sparse-checkout set failed: ${j.stderr}`};let H=await S7(L7(),["checkout","HEAD"],{cwd:K,timeout:A,stdin:"ignore",env:{...process.env,...b18}});if(H.code!==0)return{code:H.code,stderr:`git checkout after sparse-checkout failed: ${H.stderr}`}}return N(`git clone succeeded: ${EH6(q)}`),O}if(N(`git clone failed: url=${EH6(q)} code=${O.code} error=${O.error??"none"} stderr=${O.stderr}`,{level:"warn"}),O.error?.includes("timed out"))return{...O,stderr:`Git clone timed out after ${Math.round(A/1000)}s. The repository may be too large for the current timeout. Set CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS to increase it (e.g., 300000 for 5 minutes). |