mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-05-13 06:20:24 +00:00
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:
parent
93296305f9
commit
9977df96d5
5 changed files with 105 additions and 21 deletions
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue