Skip to content

Commit f132bd7

Browse files
Joshua GrossoJoshua Grosso
authored andcommitted
Adjust for rebase-caused changes
1 parent db59e7a commit f132bd7

6 files changed

Lines changed: 30 additions & 16 deletions

File tree

src/commands/fetch.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ function fetch(repo, options) {
7878
const argsString = R.join(' ', args);
7979
return core.fetch(argsString, { cwd: repo.workdir(), shell: true }, callback)
8080
.then(({ stdout }) => {
81+
const response = generateResponse();
8182
response.raw = stdout;
8283
response.fetch = generateFetchStats(stdout);
8384

@@ -88,7 +89,7 @@ function fetch(repo, options) {
8889
}
8990

9091
return response;
91-
}, errorCatchHandler(response));
92+
}, errorCatchHandler);
9293
}
9394

9495
export default fetch;

src/commands/pull.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ function pull(repo, options) {
7777

7878
return core.pull(argsString, { cwd: repo.workdir(), shell: true }, callback)
7979
.then(({ stdout }) => {
80+
const response = generateResponse();
8081
response.raw = stdout;
8182
response.pull = generatePullStats(stdout);
8283

@@ -87,7 +88,7 @@ function pull(repo, options) {
8788
}
8889

8990
return response;
90-
}, errorCatchHandler(response));
91+
}, errorCatchHandler);
9192
}
9293

9394
export default pull;

src/commands/version.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import {
66
} from '../constants';
77
import generateResponse from '../utils/generateResponse';
88

9-
const version = () => {
10-
return core.version()
9+
const version = () =>
10+
core.version()
1111
.then(({ stdout, stderr }) => {
1212
const response = generateResponse();
1313
response.raw = stdout;

src/utils/execHelper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import child from 'child_process';
22
import R from 'ramda';
33

4-
const exec = (command, input, opts) => new Promise(
4+
const exec = (command, input, opts = {}) => new Promise(
55
(resolve, reject) => {
6-
const options = R.mergeDeepRight((opts || {}), { env: process.env });
6+
const options = R.mergeDeepRight(opts, { env: process.env });
77

88
if (process.platform !== 'win32' && !R.contains('/usr/local/bin', options.env.PATH)) {
99
options.env.PATH = `${options.env.PATH}${':/usr/local/bin'}`;

test/tests/helpers.spec.js

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,18 @@ describe('helpers', () => {
3636
});
3737
});
3838

39-
it('errors if `.gitattributes` does not exist', function () {
40-
const {
41-
emptyRepo
42-
} = this;
39+
describe('when `.gitattributes` does not exist', () => {
40+
it('errors', function () {
41+
const {
42+
emptyRepo
43+
} = this;
4344

44-
return helpers.loadGitattributeFiltersFromRepo(emptyRepo)
45-
.then(() => fail('Expected promise to fail!'))
46-
.catch((err) => {
47-
expect(err.message).to.equal('No .gitattributes found');
48-
});
45+
return helpers.loadGitattributeFiltersFromRepo(emptyRepo)
46+
.then(() => fail('Expected promise to fail!'))
47+
.catch((err) => {
48+
expect(err.message).to.equal('No .gitattributes found');
49+
});
50+
});
4951
});
5052
});
5153

@@ -78,4 +80,14 @@ describe('helpers', () => {
7880
it('returns `false`', todo);
7981
});
8082
});
83+
84+
describe('errorCatchHandler', () => {
85+
describe('when the error is from LFS', () => {
86+
it('returns a response object', todo);
87+
});
88+
89+
describe('when the error is not from LFS', () => {
90+
it('rethrows the error code', todo);
91+
});
92+
});
8193
});

test/tests/utils/execHelper.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ describe('execHelper', () => {
4040
mockProcess
4141
} = this;
4242

43-
const promise = exec('test', '', { foo: 'bar' });
43+
const promise = exec('test', '');
4444
execSpy.firstCall.args[2](null, 'some stdout', 'some stderr');
4545
return promise
4646
.then((result) => {

0 commit comments

Comments
 (0)