This commit is contained in:
Tony 2026-08-04 18:41:34 +04:00 committed by GitHub
commit 983ee3d26b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -432,7 +432,11 @@ func localFileToMarkdown(cwd string, res gitcha.SearchResult) *markdown {
}
func stripAbsolutePath(fullPath, cwd string) string {
fp, _ := filepath.EvalSymlinks(fullPath)
// Don't resolve symlinks on fullPath — use the original path so that
// symlinked files display under their own name (e.g. AGENTS.md) instead
// of their target's name (e.g. CLAUDE.md).
// We still resolve cwd in case the working directory itself is a symlink.
fp := fullPath
cp, _ := filepath.EvalSymlinks(cwd)
return strings.ReplaceAll(fp, cp+string(os.PathSeparator), "")
}