Skip to content

Commit b637af5

Browse files
committed
s/sinceCommit/toContributeTo/g
1 parent 0028f80 commit b637af5

5 files changed

Lines changed: 12 additions & 12 deletions

File tree

integration-tests/__tests__/jest_changed_files.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ test('gets changed files for git', async () => {
196196
run(`${GIT} commit -m "test3"`, DIR);
197197

198198
({changedFiles: files} = await getChangedFilesForRoots(roots, {
199-
sinceCommit: 'HEAD^^',
199+
toContributeTo: 'HEAD^^',
200200
}));
201201
// Returns files from the last 2 commits
202202
expect(
@@ -214,7 +214,7 @@ test('gets changed files for git', async () => {
214214
run(`${GIT} commit -m "test5"`, DIR);
215215

216216
({changedFiles: files} = await getChangedFilesForRoots(roots, {
217-
sinceCommit: 'master',
217+
toContributeTo: 'master',
218218
}));
219219
// Returns files from this branch but not ones that only exist on master
220220
expect(
@@ -297,7 +297,7 @@ test('gets changed files for hg', async () => {
297297
run(`${HG} commit -m "test3"`, DIR);
298298

299299
({changedFiles: files} = await getChangedFilesForRoots(roots, {
300-
sinceCommit: '-3',
300+
toContributeTo: '-3',
301301
}));
302302
// Returns files from the last 2 commits
303303
expect(
@@ -317,7 +317,7 @@ test('gets changed files for hg', async () => {
317317
run(`${HG} commit -m "test4"`, DIR);
318318

319319
({changedFiles: files} = await getChangedFilesForRoots(roots, {
320-
sinceCommit: 'master',
320+
toContributeTo: 'master',
321321
}));
322322
// Returns files from this branch but not ones that only exist on master
323323
expect(

packages/jest-changed-files/src/git.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,17 @@ const adapter: SCMAdapter = {
4949
cwd: string,
5050
options?: Options,
5151
): Promise<Array<Path>> => {
52-
const sinceCommit: ?string =
53-
options && (options.withAncestor ? 'HEAD^' : options.sinceCommit);
52+
const toContributeTo: ?string =
53+
options && (options.withAncestor ? 'HEAD^' : options.toContributeTo);
5454

5555
if (options && options.lastCommit) {
5656
return await findChangedFilesUsingCommand(
5757
['show', '--name-only', '--pretty=%b', 'HEAD'],
5858
cwd,
5959
);
60-
} else if (sinceCommit) {
60+
} else if (toContributeTo) {
6161
const committed = await findChangedFilesUsingCommand(
62-
['log', '--name-only', '--pretty=%b', 'HEAD', `^${sinceCommit}`],
62+
['log', '--name-only', '--pretty=%b', 'HEAD', `^${toContributeTo}`],
6363
cwd,
6464
);
6565
const staged = await findChangedFilesUsingCommand(

packages/jest-changed-files/src/hg.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ const adapter: SCMAdapter = {
2626
let args = ['status', '-amnu'];
2727
if (options && options.withAncestor) {
2828
args.push('--rev', 'ancestor(.^)');
29-
} else if (options && options.sinceCommit) {
30-
args.push('--rev', `ancestor(., ${options.sinceCommit})`);
29+
} else if (options && options.toContributeTo) {
30+
args.push('--rev', `ancestor(., ${options.toContributeTo})`);
3131
} else if (options && options.lastCommit === true) {
3232
args = ['tip', '--template', '{files%"{file}\n"}'];
3333
}

packages/jest-cli/src/get_changed_files_promise.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default (
2222
);
2323
return getChangedFilesForRoots(allRootsForAllProjects, {
2424
lastCommit: globalConfig.lastCommit,
25-
sinceCommit: globalConfig.changedFilesToContributeTo,
25+
toContributeTo: globalConfig.changedFilesToContributeTo,
2626
withAncestor: globalConfig.changedFilesWithAncestor,
2727
});
2828
}

types/ChangedFiles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import type {Path} from 'types/Config';
1212
export type Options = {|
1313
lastCommit?: boolean,
1414
withAncestor?: boolean,
15-
sinceCommit?: string,
15+
toContributeTo?: string,
1616
|};
1717

1818
export type ChangedFiles = Set<Path>;

0 commit comments

Comments
 (0)