Skip to content

Commit db84d8b

Browse files
committed
switch git repo download to shallow pull & amend init tests
1 parent b838f21 commit db84d8b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

packages/theme/src/cli/services/init.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@ describe('cloneRepoAndCheckoutLatestTag()', async () => {
2424
const repoUrl = 'https://github.com/Shopify/dawn.git'
2525
const destination = 'destination'
2626
const latestTag = true
27+
const shallow = true
2728

2829
// When
2930
await cloneRepoAndCheckoutLatestTag(repoUrl, destination)
3031

3132
// Then
32-
expect(downloadGitRepository).toHaveBeenCalledWith({repoUrl, destination, latestTag})
33+
expect(downloadGitRepository).toHaveBeenCalledWith({repoUrl, destination, latestTag, shallow})
3334
})
3435
})
3536

@@ -38,12 +39,12 @@ describe('cloneRepo()', async () => {
3839
// Given
3940
const repoUrl = 'https://github.com/Shopify/dawn.git'
4041
const destination = 'destination'
41-
42+
const shallow = true
4243
// When
4344
await cloneRepo(repoUrl, destination)
4445

4546
// Then
46-
expect(downloadGitRepository).toHaveBeenCalledWith({repoUrl, destination})
47+
expect(downloadGitRepository).toHaveBeenCalledWith({repoUrl, destination, shallow})
4748
})
4849
})
4950

packages/theme/src/cli/services/init.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ async function downloadRepository(repoUrl: string, destination: string, latestTa
2121
repoUrl,
2222
destination,
2323
latestTag,
24+
shallow: true,
2425
})
2526
await removeGitRemote(destination)
2627
},

0 commit comments

Comments
 (0)