Skip to content

Commit

Permalink
Support spaces in git repository path
Browse files Browse the repository at this point in the history
  • Loading branch information
davidstosik committed Oct 7, 2024
1 parent e34031f commit 0840fdf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/kamal/commands/builder/clone.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ module Kamal::Commands::Builder::Clone
end

def clone
git :clone, Kamal::Git.root, "--recurse-submodules", path: clone_directory
git :clone, escaped_root, "--recurse-submodules", path: clone_directory
end

def clone_reset_steps
[
git(:remote, "set-url", :origin, Kamal::Git.root, path: build_directory),
git(:remote, "set-url", :origin, escaped_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),
Expand All @@ -26,4 +26,8 @@ def clone_status
def clone_revision
git :"rev-parse", :HEAD, path: build_directory
end

def escaped_root
Kamal::Git.root.shellescape
end
end

0 comments on commit 0840fdf

Please sign in to comment.