fix: "Follow symlink" to work with arbitrary links (#12246)

This change introduces a Path method on the TreeEntry struct, that
collects the path by moving upwards in the tree.

The existing FollowSymlink(s) methods interface has been changed, the
previously returned string has been removed, as after the fix it wasn't
used anywhere.

Fixes: #9931

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/12246
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
This commit is contained in:
Gabor Pihaj 2026-04-27 23:54:21 +02:00 committed by Gusted
parent 93296305f9
commit 9977df96d5
5 changed files with 105 additions and 21 deletions

View file

@ -103,7 +103,7 @@ func Int64sToStrings(ints []int64) []string {
func EntryIcon(entry *git.TreeEntry) string {
switch {
case entry.IsLink():
te, _, err := entry.FollowLink()
te, err := entry.FollowLink()
if err != nil {
log.Debug(err.Error())
return "file-symlink-file"