-
Notifications
You must be signed in to change notification settings - Fork 482
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1066 from davidstosik/v2.1.1/path-space-fix
Support spaces in git repository path
- Loading branch information
Showing
2 changed files
with
31 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,31 @@ | ||
module Kamal::Commands::Builder::Clone | ||
extend ActiveSupport::Concern | ||
|
||
included do | ||
delegate :clone_directory, :build_directory, to: :"config.builder" | ||
end | ||
|
||
def clone | ||
git :clone, Kamal::Git.root, "--recurse-submodules", path: clone_directory | ||
git :clone, escaped_root, "--recurse-submodules", path: config.builder.clone_directory.shellescape | ||
end | ||
|
||
def clone_reset_steps | ||
[ | ||
git(:remote, "set-url", :origin, Kamal::Git.root, path: build_directory), | ||
git(:fetch, :origin, path: build_directory), | ||
git(:reset, "--hard", Kamal::Git.revision, path: build_directory), | ||
git(:clean, "-fdx", path: build_directory), | ||
git(:submodule, :update, "--init", path: build_directory) | ||
git(:remote, "set-url", :origin, escaped_root, path: escaped_build_directory), | ||
git(:fetch, :origin, path: escaped_build_directory), | ||
git(:reset, "--hard", Kamal::Git.revision, path: escaped_build_directory), | ||
git(:clean, "-fdx", path: escaped_build_directory), | ||
git(:submodule, :update, "--init", path: escaped_build_directory) | ||
] | ||
end | ||
|
||
def clone_status | ||
git :status, "--porcelain", path: build_directory | ||
git :status, "--porcelain", path: escaped_build_directory | ||
end | ||
|
||
def clone_revision | ||
git :"rev-parse", :HEAD, path: build_directory | ||
git :"rev-parse", :HEAD, path: escaped_build_directory | ||
end | ||
|
||
def escaped_root | ||
Kamal::Git.root.shellescape | ||
end | ||
|
||
def escaped_build_directory | ||
config.builder.build_directory.shellescape | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters