Skip to content

Commit 52a8ad8

Browse files
committed
Rename the option name to filterBlobs, fix and get the proper options from the repo.
1 parent 6aa0307 commit 52a8ad8

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ Properties:
170170
- `tag`: Optional. Tag name.
171171
- `develop`: Optional. Boolean, can be toggled on/off to activate/deactivate a package. If activated, then deactivated afterwards, the package gets removed from `jsconfig` maintaining the synchronization with `mrs.developer.json`. Default is `true`.
172172
- `output`: Optional. Output directory override per repository.
173-
- `noDepth`: Optional. Used together with `tag` or `branch`, it creates a partial clone defaulting to the tag or branch specified.
173+
- `filterBlobs`: Optional. Used together with `tag` or `branch`, it creates a partial clone defaulting to the tag or branch specified. This partial clone won't clone the whole repository, but only the tag or branch specified.
174174

175175
## Usage with (non-TypeScript) React
176176

src/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ function getDefaultBranch(repository) {
4242

4343
function cloneRepository(name, path, url, fetchUrl, options = {}) {
4444
console.log(`Cloning ${name} from ${fetchUrl || url}...`);
45-
const { noDepth, tag, branch } = options;
45+
const { filterBlobs, tag, branch } = options;
4646
const cloneOptions =
47-
noDepth && (tag || branch)
47+
filterBlobs && (tag || branch)
4848
? ['-b', tag || branch, '--filter=blob:none']
4949
: undefined;
5050
return gitP()
@@ -220,7 +220,7 @@ function checkoutRepository(name, root, settings, options) {
220220
fetchUrl = settings.https;
221221
}
222222
const promise = !fs.existsSync(pathToRepo)
223-
? cloneRepository(name, pathToRepo, url, fetchUrl, options)
223+
? cloneRepository(name, pathToRepo, url, fetchUrl, settings)
224224
: openRepository(name, pathToRepo);
225225
return promise.then((git) => {
226226
if (git) {

test/cloneRepositoryTest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe('cloneRepository', () => {
2323

2424
it('puts the repository in ./src/develop with a partial (noDeep) clone', async () => {
2525
const repo = await developer
26-
.cloneRepository('repo1', './test/src/develop/repo1', './test/fake-remote/repo1', null, { noDepth: true, tag: '1.0.0' });
26+
.cloneRepository('repo1', './test/src/develop/repo1', './test/fake-remote/repo1', null, { filterBlobs: true, tag: '1.0.0' });
2727

2828
const branches = await repo.branchLocal();
2929
expect(branches.all[0]).to.be.equals('(no');

0 commit comments

Comments
 (0)