Skip to content

Commit 8dffd7a

Browse files
committed
Fix #3: Multiple parent directory .. references were resolved incorrectly
I would have liked to use the original commit by Camillo Bruni from 2014, but in Pharo 8 the history stops in 2017 with bef708e99d12d365d18623abd94afe1e579caf6c "sources converted." (to Tonel) and in Pharo 6.1 the Monticello history of FileSystem-Core also stops in 2016 because FileSystem-Core-MarcusDenker.155 has no ancestors. How disappointing!
1 parent 1c9c31d commit 8dffd7a

File tree

8 files changed

+52
-4
lines changed

8 files changed

+52
-4
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
SquotTrackedObjectMetadata {
22
#objectClassName : #PackageInfo,
3+
#objectsReplacedByNames : true,
34
#serializer : #SquotCypressCodeSerializer
45
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
private
22
addParentElementTo: result
3-
result isEmpty
4-
ifTrue: [result add: '..']
5-
ifFalse: [result removeLast]
3+
(result isEmpty or: [ result last = '..' ])
4+
ifTrue: [ result add: '..' ]
5+
ifFalse: [ result removeLast ]
66

src/FS-Core.package/FSPath.class/methodProperties.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"/" : "CamilloBruni 8/15/2011 17:36",
55
"addElement:to:" : "CamilloBruni 1/19/2012 15:03",
66
"addEmptyElementTo:" : "cwp 10/26/2009 13:41",
7-
"addParentElementTo:" : "cwp 10/26/2009 13:39",
7+
"addParentElementTo:" : "CamilloBruni 2/14/2014 14:46",
88
"canonicalizeElements:" : "cwp 10/26/2009 13:30",
99
"extensionDelimiter" : "StephaneDucasse 2/18/2011 22:31",
1010
"from:delimiter:" : "jr 7/19/2017 18:31",
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
tests
2+
testRelativeFromString
3+
4+
| path |
5+
6+
path := Path from: 'plonk/griffle'.
7+
8+
self assert: path isRelative.
9+
self assert: path size equals: 2.
10+
self assert: (path at: 1) equals: 'plonk'.
11+
self assert: (path at: 2) equals: 'griffle'.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
tests
2+
testRelativeFromStringNormalization
3+
4+
| path |
5+
6+
path := Path from: 'plonk/../griffle'.
7+
8+
self assert: path isRelative.
9+
self assert: path size equals: 1.
10+
self assert: (path at: 1) equals: 'griffle'.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
tests
2+
testRelativeFromStringNormalizationParent
3+
4+
| path |
5+
6+
path := Path from: 'plonk/../../griffle'.
7+
8+
self assert: path isRelative.
9+
self assert: path size equals: 2.
10+
self assert: (path at: 1) equals: '..'.
11+
self assert: (path at: 2) equals: 'griffle'.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
tests
2+
testRelativeFromStringParent
3+
4+
| path |
5+
6+
path := Path from: '../..'.
7+
8+
self assert: path isRelative.
9+
self assert: path size equals: 2.
10+
self assert: (path at: 1) equals: '..'.
11+
self assert: (path at: 2) equals: '..'.

src/FS-Tests-Core.package/FSPathTest.class/methodProperties.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030
"testParseTrailingSlash" : "CamilloBruni 1/19/2012 15:00",
3131
"testPrintRelativeWithParent" : "cwp 3/29/2011 16:46",
3232
"testPrintWithDelimiter" : "cwp 2/26/2011 11:00",
33+
"testRelativeFromString" : "CamilloBruni 2/14/2014 14:39",
34+
"testRelativeFromStringNormalization" : "CamilloBruni 2/14/2014 14:41",
35+
"testRelativeFromStringNormalizationParent" : "CamilloBruni 2/14/2014 14:41",
36+
"testRelativeFromStringParent" : "CamilloBruni 2/14/2014 14:41",
3337
"testRelativePrintString" : "cwp 2/27/2011 09:31",
3438
"testRelativeTo" : "StephaneDucasse 2/18/2011 21:55",
3539
"testRelativeToBranch" : "cwp 11/15/2009 00:21",

0 commit comments

Comments
 (0)