-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use faster worktree instead of cloning
extracted from #944
- Loading branch information
Showing
7 changed files
with
31 additions
and
80 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
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
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# frozen_string_literal: true | ||
min = "2.5.0" | ||
raise "Git not found" unless version = `git --version`[/\d+\.\d+\.\d+/] | ||
raise "Need git v#{min}+" if Gem::Version.new(version) < Gem::Version.new(min) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
|
@@ -38,6 +38,7 @@ def last_line_of_output | |
user.name = 'John Doe' | ||
user.email = '[email protected]' | ||
project.repository.send(:clone!) | ||
project.repository.stubs(:prune_worktree) | ||
job.deploy = deploy | ||
freeze_time | ||
end | ||
|
@@ -478,5 +479,14 @@ def perform | |
111 | ||
end.must_equal 111 | ||
end | ||
|
||
it "removes deleted worktrees" do | ||
project.repository.unstub(:prune_worktree) | ||
before = `cd #{project.repository.repo_cache_dir} && git worktree list` | ||
execution.send(:make_tempdir) do |dir| | ||
assert project.repository.checkout_workspace(dir, "master") | ||
end | ||
`cd #{project.repository.repo_cache_dir} && git worktree list`.must_equal before | ||
end | ||
end | ||
end |