You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pkg/gitfs/fs.go
+52-3Lines changed: 52 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,11 @@
1
1
package gitfs
2
2
3
3
import (
4
+
"fmt"
4
5
"io"
5
6
"io/fs"
6
7
"path"
8
+
"strings"
7
9
"time"
8
10
9
11
goGit "github.com/go-git/go-git/v5"
@@ -31,17 +33,57 @@ type gitFS struct {
31
33
commit*goGitPlumbingObject.Commit
32
34
}
33
35
36
+
// apparently symlinks in "io/fs" are still a big TODO (https://github.com/golang/go/issues/49580, https://github.com/golang/go/issues/45470, etc related issues); all the existing interfaces assume symlinks don't exist
37
+
//
38
+
// if the File object passed to this function represents a symlink, this returns the (resolved) path that should be looked up instead; only relative symlinks are supported (and attempts to escape the repository with too many "../" *should* result in an error -- this is a convenience/sanity check, not a security boundary; subset of https://pkg.go.dev/io/fs#ValidPath)
39
+
//
40
+
// otherwise, it will return the empty string and nil
0 commit comments