Skip to content

Commit

Permalink
Fix issue pharo-vcs#984
Browse files Browse the repository at this point in the history
 - add test for file corruption
 - fix properties file writing
  • Loading branch information
guillep committed Oct 2, 2018
1 parent 1066e84 commit 3b18204
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
tests
testConvertToFiletreeDoesNotCorruptPropertiesFile
self repository properties fileFormat: IceLibgitTonelWriter.
self repository workingCopy addPackageNamed: self packageName1.
self repository workingCopy
createClass: 'IceGeneratedClassForTesting'
inPackage: self packageName1 asSymbol.
self repository commitWithMessage: 'First commit'.

self
assert: self repository writerClass
equals: IceLibgitTonelWriter.

IceConvertFormatAction new
repository: self repository;
branchName: 'migrate-to-filetree';
mergeWithCurrentBranch: true;
format: #filetree;
execute.

self
assert: (self repository workingCopy fileSystem / '.properties') contents
equals: '{
#format : #filetree
}'
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
tests
testConvertToTonelDoesNotCorruptPropertiesFile
self repository properties fileFormat: IceLibgitFiletreeWriter.
self repository workingCopy addPackageNamed: self packageName1.
self repository workingCopy
createClass: 'IceGeneratedClassForTesting'
inPackage: self packageName1 asSymbol.
self repository commitWithMessage: 'First commit'.

self
assert: self repository writerClass
equals: IceLibgitFiletreeWriter.

IceConvertFormatAction new
repository: self repository;
branchName: 'migrate-to-filetree';
mergeWithCurrentBranch: true;
format: #tonel;
execute.

self
assert: (self repository workingCopy fileSystem / '.properties') contents
equals: '{
#format : #tonel
}'
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ migrateSources
commit: commit ].

(self repository workingCopy fileSystem resolve: self repository properties propertiesFilePath)
ensureDelete;
binaryWriteStreamDo: [ :stream |
stream nextPutAll: (self repository properties
fileFormatId: self format;
Expand Down

0 comments on commit 3b18204

Please sign in to comment.