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

Support spaces in git repository path #1066

Merged
merged 4 commits into from
Oct 10, 2024

Conversation

davidstosik
Copy link
Contributor

@davidstosik davidstosik commented Oct 6, 2024

Fixes #1036

I haven't written any tests for this though I'd be interested to try.


included do
delegate :clone_directory, :build_directory, to: :"config.builder"
end
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This delegation becomes superfluous when we need to escape the values returned by clone_directory and build_directory, so I just removed it. Inlined config.builder.clone_directory.shellescape in the single location it's needed, and factorized config.builder.build_directory.shellescape in the escaped_build_directory method.

def build_directory
"#{Dir.tmpdir}/kamal-clones/app/kamal/"
end

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wondered what this was, and realized it has become unnecessary when tests still passed without it.

@davidstosik davidstosik force-pushed the v2.1.1/path-space-fix branch from 0bb649d to f45c754 Compare October 7, 2024 06:46
@davidstosik
Copy link
Contributor Author

cc @djmb

@djmb djmb merged commit 493c569 into basecamp:main Oct 10, 2024
6 checks passed
@djmb
Copy link
Collaborator

djmb commented Oct 10, 2024

Thanks @davidstosik!

@davidstosik davidstosik deleted the v2.1.1/path-space-fix branch October 12, 2024 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SSHKit does not escape command arguments, resulting in failure to clone a path with spaces
2 participants