Skip to content

Commit 053a11c

Browse files
committed
command, server: follow symlink one level deep
Signed-off-by: bake <[email protected]>
1 parent 042dd2c commit 053a11c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

cmd/gitbase/command/server.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,17 @@ func (c *Server) addMatch(match string) error {
273273
return err
274274
}
275275

276+
rooti, err := os.Lstat(root)
277+
if err != nil {
278+
return err
279+
}
280+
if rooti.Mode()&os.ModeSymlink != 0 {
281+
root, err = os.Readlink(root)
282+
if err != nil {
283+
return err
284+
}
285+
}
286+
276287
initDepth := strings.Count(root, string(os.PathSeparator))
277288
return filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
278289
if err != nil {

0 commit comments

Comments
 (0)