all repos — legit @ d6fa0d66c9f6a6c41030f28872132f4290671c48

Unnamed repository; edit this file 'description' to name the repository.

fix: resolve symlinks when scanning for git repos

filepath.WalkDir does not follow symlinks by design, so symlinks
pointing to git repositories were silently skipped. Resolve symlinks
before checking for a HEAD file, and track resolved paths to avoid
duplicate entries when multiple symlinks point to the same target.
Maxwell Jensen 85795372+maxwelljens@users.noreply.github.com
Tue, 12 May 2026 12:07:37 +0200
commit

d6fa0d66c9f6a6c41030f28872132f4290671c48

parent

3711bd7c2406a4c1d3cd5eddf473c8d73d5c35e7

1 files changed, 31 insertions(+), 0 deletions(-)

jump to
M routes/util.goroutes/util.go

@@ -58,6 +58,7 @@ }

func (d *deps) getAllRepos() ([]repoInfo, error) { repos := []repoInfo{} + seen := map[string]bool{} max := strings.Count(d.c.Repo.ScanPath, string(os.PathSeparator)) + 2 err := filepath.WalkDir(d.c.Repo.ScanPath, func(path string, de fs.DirEntry, err error) error {

@@ -91,6 +92,36 @@ })

// Since we found a Git repo, we don't want to recurse // further return fs.SkipDir + } + } + } else if de.Type()&fs.ModeSymlink != 0 { + if d.isIgnored(path) { + return nil + } + + target, err := filepath.EvalSymlinks(path) + if err != nil { + log.Printf("failed to resolve symlink %s: %v", path, err) + return nil + } + + // Avoid duplicates if multiple symlinks point to the same target + if seen[target] { + return nil + } + seen[target] = true + + if _, err := os.Stat(filepath.Join(target, "HEAD")); err == nil { + repo, err := git.Open(target, "") + if err != nil { + log.Println(err) + } else { + relpath, _ := filepath.Rel(d.c.Repo.ScanPath, path) + repos = append(repos, repoInfo{ + Git: repo, + Path: relpath, + Category: d.category(path), + }) } } }