Skip to content

Commit a1cb7c3

Browse files
committed
Add Author fullName to the list of authors. Error out when no authors were provided.
1 parent a4fa8f0 commit a1cb7c3

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

repository/GitMigration/GitMigration.class.st

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ GitMigration >> allAuthors [
3232
allAuthors
3333
ifNil: [ | authorsSet |
3434
authorsSet := Set new.
35+
authorsSet add: Author fullName.
3536
self versions
3637
do: [ :each | authorsSet addAll: (self authorsInSnapshot: each veryDeepCopy snapshot) ]
3738
displayingProgress: [ :each | 'Loading authors... ' , each info name ].
@@ -134,22 +135,21 @@ GitMigration >> completeAncestryOfPackageNamed: aPackageName [
134135
GitMigration >> createFastImportAt: anInitialCommitish usingWriter: aWriter [
135136
| totalOrdering versions |
136137
aWriter initialCommit: anInitialCommitish.
138+
(authors isNil or: [ authors isEmpty ])
139+
ifTrue: [ self error: 'Please provide authors.' ].
137140
authors
138-
keysAndValuesDo: [ :key :duet |
139-
aWriter authorMapping
140-
shortName: key
141-
name: duet first
142-
email: ((duet second withoutPrefix: '<') withoutSuffix: '>') ].
141+
keysAndValuesDo:
142+
[ :key :duet | aWriter authorMapping shortName: key name: duet first email: ((duet second withoutPrefix: '<') withoutSuffix: '>') ].
143143
self
144144
do: [ totalOrdering := self commitOrder.
145-
versions := totalOrdering
146-
collect: [ :info | self versions detect: [ :version | version info = info ] ] ]
145+
versions := totalOrdering collect: [ :info | self versions detect: [ :version | version info = info ] ] ]
147146
displaying: 'Ordering history...'.
148147
aWriter availableVersions: (versions collect: #info).
149148
self preChecksOn: versions.
150149
versions
151150
do: [ :each | aWriter writeVersion: each veryDeepCopy ]
152-
displayingProgress: [ :each | 'Exporting version ', each info name ]
151+
displayingProgress: [ :each | 'Exporting version ' , each info name ]
152+
every: 0
153153
]
154154

155155
{ #category : #ui }

repository/GitMigration/GitMigrationTest.class.st

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@ GitMigrationTest >> setUp [
3939
self ensureAllCached
4040
]
4141

42+
{ #category : #'tests - accessing' }
43+
GitMigrationTest >> testAllAuthors [
44+
| oldName |
45+
oldName := Author fullName.
46+
[ Author fullName: 'LocalUser'.
47+
self assert: (migration allAuthors includes: 'LocalUser') ]
48+
ensure: [ Author fullName: oldName ]
49+
]
50+
4251
{ #category : #'tests - accessing' }
4352
GitMigrationTest >> testAuthorsOk [
4453
self

0 commit comments

Comments
 (0)