Disable SSH askpass for upstream status fetches #1921
Closedmerrkry(GitHub profile, opens in a new tab)wants to merge 1 commit into
main fromrefs/pull/1921/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
- apps/server/src/git/Layers/GitCore.ts lines 933 to 934OutdatedResolvedby merrkry(GitHub profile, opens in a new tab)@@ -929,4 +929,6 @@929929 return executeGit(930930 "GitCore.fetchUpstreamRefForStatus",931931 fetchCwd,932- ["--git-dir", gitCommonDir, "fetch", "--quiet", "--no-tags", upstream.remoteName, refspec],932+ [933+ "-c",934+ "core.sshCommand=ssh -o BatchMode=yes",
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:S
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
merrkry(GitHub profile, opens in a new tab) changed the title
gameroman(GitHub profile, opens in a new tab) approved these changes
merrkry(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
📝 Walkthrough
Walkthrough#
The changes extend git command execution infrastructure to support custom environment variables. An optional
envparameter is added toExecuteGitOptions, and a specific environment override (SSH_ASKPASS_REQUIRE: "never") is applied to upstream status refresh fetch operations to suppress SSH password prompts.Changes#
apps/server/src/git/Layers/GitCore.tsExecuteGitOptionsinterface with optionalenvproperty and updatedexecuteGitwiring to pass environment variables toChildProcess.make(). Added per-commandenvoverride for upstream status fetch settingSSH_ASKPASS_REQUIRE: "never".apps/server/src/git/Layers/GitCore.test.tsfetchEnvvariable to verify that the upstream status refresh fetch invocation receives the expected environment override{ SSH_ASKPASS_REQUIRE: "never" }.Estimated code review effort#
🎯 1 (Trivial) | ⏱️ ~3 minutes
Poem#
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share