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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d6f09d39d485e7f385255ca9c5c60610785536aeff46726e368810183b2e53a5
4
- data.tar.gz: b0c83767bb00a625abdede0961c60f8144f691685bdfca1bb0c7f397e20cccb2
3
+ metadata.gz: 2da379c2c47cd84f92907ba6095ed656563316a58806111ff60676bb68175157
4
+ data.tar.gz: 7bc30f52cbd2f8cf91d40f108fd36c40f82da8c37386d428e7faf59c6431186f
5
5
  SHA512:
6
- metadata.gz: a9a8f5364a360508d19b6a6ccc3d327eabf18810dc3c1b8276223839e82cc6a62f4767a85def8299fa3c335f852277b56c008fb390b3621226edeb346d22a0f7
7
- data.tar.gz: a1b64634b2a1a4647f9fa622402d5d9f3221da277f58b52e5da826df93cc919d2b0df19d44d6e00e3d8ae93606f3eacb2522e630f4f94dc80b5f961bbd7e1c09
6
+ metadata.gz: b99f903732f2a3b1607e544f7b778d9503daa40145db48bae0e695f34f7aea6f60ffc09ba3a2bb2e4fea6bcaec92459243d644fac572eab5040ad8349193cd77
7
+ data.tar.gz: f3586247be04241d0c9bb62c5bc76b37420800c13182640e9d8a4529e5e69df0153c8d2c4a7fcedb68e8c3f3be7499f4da4ab6dc3e14dee5b91efd2e2ac9f1ec
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Version string for git-fastclone
4
4
  module GitFastCloneVersion
5
- VERSION = '1.6.0'
5
+ VERSION = '1.6.1'
6
6
  end
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.0
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-24 00:00:00.000000000 Z
12
+ date: 2025-11-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: colorize