Skip to content

Commit 508e602

Browse files
committed
fix: While use of the ListLogSummary type is deprecated in favour of the new LogResult, the alias type should also support the default generic DefaultLogFields to allow downstream consumers to upgrade to newer 2.x versions without the need to specify a generic.
Closes #586
1 parent d3e8dc7 commit 508e602

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

test/unit/log.spec.ts

+15-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { SimpleGit } from 'typings';
1+
import { ListLogSummary, SimpleGit } from 'typings';
22
import {
33
assertExecutedCommands,
44
assertExecutedCommandsContains,
@@ -309,9 +309,9 @@ ${START_BOUNDARY}jkl${COMMIT_BOUNDARY}
309309
const parser = createListLogSummaryParser(splitOn.SEMIS);
310310
const actual = parser(`
311311
312-
${ START_BOUNDARY }aaa;;;;;2018-09-13 06:52:30 +0100;;;;;WIP on master: 2942035 blah (refs/stash);;;;;Steve King;;;;;steve@mydev.co${ COMMIT_BOUNDARY }
313-
${ START_BOUNDARY }bbb;;;;;2018-09-13 06:52:10 +0100;;;;;WIP on master: 2942035 blah;;;;;Steve King;;;;;steve@mydev.co${ COMMIT_BOUNDARY }
314-
${ START_BOUNDARY }ccc;;;;;2018-09-13 06:48:22 +0100;;;;;WIP on master: 2942035 blah;;;;;Steve King;;;;;steve@mydev.co${ COMMIT_BOUNDARY }
312+
${START_BOUNDARY}aaa;;;;;2018-09-13 06:52:30 +0100;;;;;WIP on master: 2942035 blah (refs/stash);;;;;Steve King;;;;;steve@mydev.co${COMMIT_BOUNDARY}
313+
${START_BOUNDARY}bbb;;;;;2018-09-13 06:52:10 +0100;;;;;WIP on master: 2942035 blah;;;;;Steve King;;;;;steve@mydev.co${COMMIT_BOUNDARY}
314+
${START_BOUNDARY}ccc;;;;;2018-09-13 06:48:22 +0100;;;;;WIP on master: 2942035 blah;;;;;Steve King;;;;;steve@mydev.co${COMMIT_BOUNDARY}
315315
316316
`);
317317

@@ -321,9 +321,9 @@ ${ START_BOUNDARY }ccc;;;;;2018-09-13 06:48:22 +0100;;;;;WIP on master: 2942035
321321
hash: 'aaa'
322322
}),
323323
all: [
324-
like({ hash: 'aaa'}),
325-
like({ hash: 'bbb'}),
326-
like({ hash: 'ccc'}),
324+
like({hash: 'aaa'}),
325+
like({hash: 'bbb'}),
326+
like({hash: 'ccc'}),
327327
]
328328
}));
329329

@@ -521,4 +521,12 @@ ${START_BOUNDARY}207601debebc170830f2921acf2b6b27034c3b1f::2016-01-03 15:50:58 +
521521
});
522522
});
523523

524+
describe('deprecations', () => {
525+
it('supports ListLogSummary without generic type', async () => {
526+
const summary: Promise<ListLogSummary> = git.log({from: 'from', to: 'to'});
527+
await closeWithSuccess();
528+
529+
expect(summary).not.toBe(undefined);
530+
});
531+
});
524532
});

typings/response.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -450,4 +450,4 @@ export type MoveSummary = MoveResult;
450450
/**
451451
* @deprecated to aid consistent naming, please use `LogResult` instead of `ListLogSummary`.
452452
*/
453-
export type ListLogSummary<T> = LogResult<T>;
453+
export type ListLogSummary<T = DefaultLogFields> = LogResult<T>;

0 commit comments

Comments
 (0)