Skip to content

Follow file symlinks in the UI to their target #28835

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Jun 30, 2025
Merged
Prev Previous commit
Next Next commit
fix test
  • Loading branch information
wxiaoguang committed Jun 28, 2025
commit 4a64b6938b3dd4275f8f82bcddf3fa79be9cf53a
3 changes: 2 additions & 1 deletion modules/git/commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import (

// Commit represents a git commit.
type Commit struct {
Tree
Tree // FIXME: bad design, this field can be nil if the commit is from "last commit cache"

ID ObjectID // The ID of this commit object
Author *Signature
Committer *Signature
Expand Down
8 changes: 4 additions & 4 deletions routers/web/repo/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,12 @@ func LastCommit(ctx *context.Context) {
ctx.HTML(http.StatusOK, tplRepoViewList)
}

func prepareDirectoryFileIcons(ctx *context.Context, parentDir string, files []git.CommitInfo) {
func prepareDirectoryFileIcons(ctx *context.Context, files []git.CommitInfo) {
renderedIconPool := fileicon.NewRenderedIconPool()
fileIcons := map[string]template.HTML{}
for _, f := range files {
fullPath := path.Join(parentDir, f.Entry.Name())
entryInfo := fileicon.EntryInfoFromGitTreeEntry(f.Commit, fullPath, f.Entry)
fullPath := path.Join(ctx.Repo.TreePath, f.Entry.Name())
entryInfo := fileicon.EntryInfoFromGitTreeEntry(ctx.Repo.Commit, fullPath, f.Entry)
fileIcons[f.Entry.Name()] = fileicon.RenderEntryIconHTML(renderedIconPool, entryInfo)
}
fileIcons[".."] = fileicon.RenderEntryIconHTML(renderedIconPool, fileicon.EntryInfoFolder())
Expand Down Expand Up @@ -308,7 +308,7 @@ func renderDirectoryFiles(ctx *context.Context, timeout time.Duration) git.Entri
return nil
}
ctx.Data["Files"] = files
prepareDirectoryFileIcons(ctx, ctx.Repo.TreePath, files)
prepareDirectoryFileIcons(ctx, files)
for _, f := range files {
if f.Commit == nil {
ctx.Data["HasFilesWithoutLatestCommit"] = true
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy