git-fastclone 1.6.0 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/git-fastclone/version.rb +1 -1
- data/lib/git-fastclone.rb +3 -1
- data/spec/git_fastclone_runner_spec.rb +41 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2da379c2c47cd84f92907ba6095ed656563316a58806111ff60676bb68175157
|
|
4
|
+
data.tar.gz: 7bc30f52cbd2f8cf91d40f108fd36c40f82da8c37386d428e7faf59c6431186f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b99f903732f2a3b1607e544f7b778d9503daa40145db48bae0e695f34f7aea6f60ffc09ba3a2bb2e4fea6bcaec92459243d644fac572eab5040ad8349193cd77
|
|
7
|
+
data.tar.gz: f3586247be04241d0c9bb62c5bc76b37420800c13182640e9d8a4529e5e69df0153c8d2c4a7fcedb68e8c3f3be7499f4da4ab6dc3e14dee5b91efd2e2ac9f1ec
|
data/lib/git-fastclone.rb
CHANGED
|
@@ -253,9 +253,11 @@ module GitFastClone
|
|
|
253
253
|
|
|
254
254
|
clone_commands = ['git', 'clone', verbose ? '--verbose' : '--quiet']
|
|
255
255
|
# For sparse checkouts, clone directly from the local mirror and skip the actual checkout process
|
|
256
|
+
# --shared is included so that the checkout remains fast even if the reference and destination directories
|
|
257
|
+
# live on different filesystem volumes.
|
|
256
258
|
# For normal clones, use --reference and clone from the remote URL
|
|
257
259
|
if sparse_paths
|
|
258
|
-
clone_commands.push('--no-checkout')
|
|
260
|
+
clone_commands.push('--no-checkout', '--shared')
|
|
259
261
|
clone_commands << mirror.to_s << clone_dest
|
|
260
262
|
else
|
|
261
263
|
clone_commands << '--reference' << mirror.to_s << url.to_s << clone_dest
|
|
@@ -145,6 +145,47 @@ describe GitFastClone::Runner do
|
|
|
145
145
|
end
|
|
146
146
|
end
|
|
147
147
|
|
|
148
|
+
context 'with sparse checkout' do
|
|
149
|
+
before(:each) do
|
|
150
|
+
subject.sparse_paths = %w[path1 path2]
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
it 'should clone with --no-checkout and --shared flags' do
|
|
154
|
+
expect(subject).to receive(:fail_on_error).with(
|
|
155
|
+
'git', 'clone', '--quiet', '--no-checkout', '--shared', '/cache', '/pwd/.',
|
|
156
|
+
{ quiet: true, print_on_failure: false }
|
|
157
|
+
) { runner_execution_double }
|
|
158
|
+
expect(subject).to receive(:perform_sparse_checkout).with('/pwd/.', 'PH')
|
|
159
|
+
|
|
160
|
+
subject.clone(placeholder_arg, 'PH', '.', nil)
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
it 'should clone with verbose mode and --shared flag' do
|
|
164
|
+
subject.verbose = true
|
|
165
|
+
expect(subject).to receive(:fail_on_error).with(
|
|
166
|
+
'git', 'clone', '--verbose', '--no-checkout', '--shared', '/cache', '/pwd/.',
|
|
167
|
+
{ quiet: false, print_on_failure: false }
|
|
168
|
+
) { runner_execution_double }
|
|
169
|
+
expect(subject).to receive(:perform_sparse_checkout).with('/pwd/.', 'PH')
|
|
170
|
+
|
|
171
|
+
subject.clone(placeholder_arg, 'PH', '.', nil)
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
it 'should not perform regular checkout when sparse checkout is enabled' do
|
|
175
|
+
expect(subject).to receive(:fail_on_error).with(
|
|
176
|
+
'git', 'clone', '--quiet', '--no-checkout', '--shared', '/cache', '/pwd/.',
|
|
177
|
+
{ quiet: true, print_on_failure: false }
|
|
178
|
+
) { runner_execution_double }
|
|
179
|
+
expect(subject).to receive(:perform_sparse_checkout).with('/pwd/.', 'PH')
|
|
180
|
+
expect(subject).not_to receive(:fail_on_error).with(
|
|
181
|
+
'git', 'checkout', '--quiet', 'PH',
|
|
182
|
+
anything
|
|
183
|
+
)
|
|
184
|
+
|
|
185
|
+
subject.clone(placeholder_arg, 'PH', '.', nil)
|
|
186
|
+
end
|
|
187
|
+
end
|
|
188
|
+
|
|
148
189
|
context 'with pre-clone-hook' do
|
|
149
190
|
let(:pre_clone_hook) { '/some/command' }
|
|
150
191
|
before(:each) do
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: git-fastclone
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.6.
|
|
4
|
+
version: 1.6.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Michael Tauraso
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2025-11-
|
|
12
|
+
date: 2025-11-27 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: colorize
|