From 9e5abab2f1aa67bbbc42762f764bf637afe62609 Mon Sep 17 00:00:00 2001 From: Alistair Grant Date: Mon, 27 Jan 2020 08:51:16 +0100 Subject: [PATCH] IceLibgitFiletreeLogReader>>loadDefinitions set the entryPath relative to the git repository root, not just the package name. Fixes: https://github.com/pharo-project/pharo/issues/5578 --- .../IceLibgitFiletreeLogReader.class.st | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Iceberg-Libgit-Filetree/IceLibgitFiletreeLogReader.class.st b/Iceberg-Libgit-Filetree/IceLibgitFiletreeLogReader.class.st index 88303e8f96..ff00a9e67b 100644 --- a/Iceberg-Libgit-Filetree/IceLibgitFiletreeLogReader.class.st +++ b/Iceberg-Libgit-Filetree/IceLibgitFiletreeLogReader.class.st @@ -8,7 +8,7 @@ Class { #instVars : [ 'fileName' ], - #category : 'Iceberg-Libgit-Filetree' + #category : #'Iceberg-Libgit-Filetree' } { #category : #'instance creation' } @@ -30,16 +30,22 @@ IceLibgitFiletreeLogReader >> fileName: aString [ { #category : #utilities } IceLibgitFiletreeLogReader >> loadDefinitions [ - | entry segments className classIsMeta | + | entry segments className classIsMeta entryPath packageIndex | definitions := OrderedCollection new. segments := (self fileName substrings: '/') allButLast asOrderedCollection. classIsMeta := segments removeLast = 'class'. className := segments last copyUpToLast: $.. - + "entryPath is the relative path from the package to the method being loaded" + packageIndex := segments indexOf: packageDirectory filename. + entryPath := packageIndex > 0 ifTrue: + [ entryPath := $/ join: (segments copyFrom: 1 to: packageIndex). + self fileName allButFirst: entryPath size ] + ifFalse: + [ self fileName allButFirst: packageDirectory filename size ]. entry := (packageDirectory - entryByPath: (self fileName allButFirst: packageDirectory filename size) + entryByPath: entryPath ifAbsent: [ ^ nil ]). entry readStreamDo: [ :fileStream | | category source timestamp selector |