Skip to content

Commit fb5c002

Browse files
committed
command, server: use filepath.EvalSymlinks instead of os.Readlink
Signed-off-by: bake <[email protected]>
1 parent e0e3ec3 commit fb5c002

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

cmd/gitbase/command/server.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -272,16 +272,10 @@ func (c *Server) addMatch(match string) error {
272272
if err != nil {
273273
return err
274274
}
275-
276-
rooti, err := os.Lstat(root)
275+
root, err = filepath.EvalSymlinks(root)
277276
if err != nil {
278277
return err
279278
}
280-
if rooti.Mode()&os.ModeSymlink != 0 {
281-
if root, err = os.Readlink(root); err != nil {
282-
return err
283-
}
284-
}
285279

286280
initDepth := strings.Count(root, string(os.PathSeparator))
287281
return filepath.Walk(root, func(path string, info os.FileInfo, err error) error {

0 commit comments

Comments
 (0)