@@ -254,12 +254,12 @@ func LastCommit(ctx *context.Context) {
254254 ctx .HTML (http .StatusOK , tplRepoViewList )
255255}
256256
257- func prepareDirectoryFileIcons (ctx * context.Context , parentDir string , files []git.CommitInfo ) {
257+ func prepareDirectoryFileIcons (ctx * context.Context , files []git.CommitInfo ) {
258258 renderedIconPool := fileicon .NewRenderedIconPool ()
259259 fileIcons := map [string ]template.HTML {}
260260 for _ , f := range files {
261- fullPath := path .Join (parentDir , f .Entry .Name ())
262- entryInfo := fileicon .EntryInfoFromGitTreeEntry (f .Commit , fullPath , f .Entry )
261+ fullPath := path .Join (ctx . Repo . TreePath , f .Entry .Name ())
262+ entryInfo := fileicon .EntryInfoFromGitTreeEntry (ctx . Repo .Commit , fullPath , f .Entry )
263263 fileIcons [f .Entry .Name ()] = fileicon .RenderEntryIconHTML (renderedIconPool , entryInfo )
264264 }
265265 fileIcons [".." ] = fileicon .RenderEntryIconHTML (renderedIconPool , fileicon .EntryInfoFolder ())
@@ -308,7 +308,7 @@ func renderDirectoryFiles(ctx *context.Context, timeout time.Duration) git.Entri
308308 return nil
309309 }
310310 ctx .Data ["Files" ] = files
311- prepareDirectoryFileIcons (ctx , ctx . Repo . TreePath , files )
311+ prepareDirectoryFileIcons (ctx , files )
312312 for _ , f := range files {
313313 if f .Commit == nil {
314314 ctx .Data ["HasFilesWithoutLatestCommit" ] = true
0 commit comments