File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed
packages/git-mob-core/src Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 22
33Follows [ Semantic Versioning] ( https://semver.org/ ) .
44
5+ ## git-mob-core 0.10.1
6+
7+ ### Fixed
8+
9+ - If an email has partially the same email as another co-author they will get included. This addresses this issue. [ Issue 213] ( https://github.com/rkotze/git-mob/issues/213 )
10+
511## git-mob 4.0.0
612
713### Added
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ const mockedGetSetCoAuthors = jest.mocked(getSetCoAuthors);
3232describe ( 'Git Mob core API' , ( ) => {
3333 afterEach ( ( ) => {
3434 mockedRemoveGitMobSection . mockReset ( ) ;
35+ mockedGetSetCoAuthors . mockReset ( ) ;
3536 mockedGitConfig . getGlobalCommitTemplate . mockReset ( ) ;
3637 mockedGitConfig . getLocalCommitTemplate . mockReset ( ) ;
3738 } ) ;
@@ -137,6 +138,17 @@ describe('Git Mob core API', () => {
137138 const selectedAuthor = listAll [ 1 ] ;
138139 mockedGetSetCoAuthors . mockResolvedValueOnce ( selectedAuthor . toString ( ) ) ;
139140 const selected = await getSelectedCoAuthors ( listAll ) ;
141+
142+ expect ( mockedGetSetCoAuthors ) . toHaveBeenCalledTimes ( 1 ) ;
143+ expect ( selected ) . toEqual ( [ selectedAuthor ] ) ;
144+ } ) ;
145+
146+ it ( 'Use exact email for selected co-authors' , async ( ) => {
147+ const listAll = buildAuthorList ( [ 'ab' , 'efcd' , 'cd' ] ) ;
148+ const selectedAuthor = listAll [ 1 ] ;
149+ mockedGetSetCoAuthors . mockResolvedValueOnce ( selectedAuthor . toString ( ) ) ;
150+ const selected = await getSelectedCoAuthors ( listAll ) ;
151+
140152 expect ( mockedGetSetCoAuthors ) . toHaveBeenCalledTimes ( 1 ) ;
141153 expect ( selected ) . toEqual ( [ selectedAuthor ] ) ;
142154 } ) ;
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ async function getSelectedCoAuthors(allAuthors: Author[]) {
8484 const coAuthorConfigValue = await getSetCoAuthors ( ) ;
8585 if ( coAuthorConfigValue ) coAuthorsString = coAuthorConfigValue ;
8686
87- return allAuthors . filter ( author => coAuthorsString . includes ( author . email ) ) ;
87+ return allAuthors . filter ( author => coAuthorsString . includes ( '<' + author . email ) ) ;
8888}
8989
9090async function solo ( ) {
You can’t perform that action at this time.
0 commit comments