Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override the ssh-askpass.sh script from the git extension to respect the workspace ssh key #400

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .rebase/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,9 @@ https://github.com/che-incubator/che-code/pull/353

- code/src/vs/server/node/extensionHostConnection.ts
---

#### @vinokurig
https://github.com/che-incubator/che-code/pull/400

- code/extensions/git/src/ssh-askpass.sh
---
6 changes: 2 additions & 4 deletions code/extensions/git/src/ssh-askpass.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/bin/sh
VSCODE_GIT_ASKPASS_PIPE=`mktemp`
ELECTRON_RUN_AS_NODE="1" VSCODE_GIT_ASKPASS_PIPE="$VSCODE_GIT_ASKPASS_PIPE" VSCODE_GIT_ASKPASS_TYPE="ssh" "$VSCODE_GIT_ASKPASS_NODE" "$VSCODE_GIT_ASKPASS_MAIN" $VSCODE_GIT_ASKPASS_EXTRA_ARGS $*
cat $VSCODE_GIT_ASKPASS_PIPE
rm $VSCODE_GIT_ASKPASS_PIPE
# see https://github.com/devfile/devworkspace-operator/blob/main/docs/additional-configuration.adoc#configuring-devworkspaces-to-use-ssh-keys-for-git-operations
cat /etc/ssh/passphrase
13 changes: 13 additions & 0 deletions rebase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,17 @@ apply_code_src_vs_code_browser_workbench_workbench_changes() {
git add code/src/vs/code/browser/workbench/workbench.ts > /dev/null 2>&1
}

# Apply changes on code/extensions/git/src/ssh-askpass.sh file
apply_code_extensions_git_src_ssh-askpass_changes() {

echo " ⚙️ reworking code/extensions/git/src/ssh-askpass.sh..."
# reset the file from local
git checkout --ours code/extensions/git/src/ssh-askpass.sh > /dev/null 2>&1

# resolve the change
git add code/extensions/git/src/ssh-askpass.sh > /dev/null 2>&1
}

# Apply changes for the given file
apply_changes() {
local filePath="$1"
Expand Down Expand Up @@ -371,6 +382,8 @@ resolve_conflicts() {
apply_code_vs_workbench_contrib_webview_browser_pre_index_no_csp_html_changes
elif [[ "$conflictingFile" == "code/src/vs/code/browser/workbench/workbench.ts" ]]; then
apply_code_src_vs_code_browser_workbench_workbench_changes
elif [[ "$conflictingFile" == "code/extensions/git/src/ssh-askpass.sh" ]]; then
apply_code_extensions_git_src_ssh-askpass_changes
elif [[ "$conflictingFile" == "code/src/vs/base/common/product.ts" ]]; then
apply_changes "$conflictingFile"
elif [[ "$conflictingFile" == "code/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.ts" ]]; then
Expand Down
Loading