Skip to content

Commit

Permalink
Fix nextVersion for cases where an entry with basename only exists in…
Browse files Browse the repository at this point in the history
… the directory.
  • Loading branch information
noha committed Nov 12, 2019
1 parent ccd1f64 commit 795385e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/FileSystem-Core/FileReference.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,8 @@ FileReference >> nextVersion [
parent := self parent.
nameWithoutExtension := self basename copyUpTo: $..

versionNumbers := parent children
"Check for filenames with the assumption it consists at least of basename and a single dot"
versionNumbers := (parent childrenMatching: nameWithoutExtension, '.*')
select: [ :f|
(f basename beginsWith: nameWithoutExtension) ]
thenCollect: [ :f|
Expand Down

0 comments on commit 795385e

Please sign in to comment.