fix(client): watch only rule paths, forget vanished worktrees, ping http2

This commit is contained in:
hh committed 2026-09-28 23:14:41 +02:00
1 parent 3b2dcffcf0
commit 4207f7e6f8
4 files changed
+165 -34

No files matched your search

+5 -2
View File
@@ -61,14 +61,17 @@ func (rules Rules) paths() []string {
func (rules Rules) covers(file string, shared bool) bool {
best := Rule{}
for _, rule := range rules {
matches := file == rule.Path || strings.HasPrefix(file, rule.Path+"/")
if matches && len(rule.Path) > len(best.Path) {
if within(file, rule.Path) && len(rule.Path) > len(best.Path) {
best = rule
}
}
return best.Path != "" && best.Shared == shared
}
func within(path, dir string) bool {
return path == dir || strings.HasPrefix(path, dir+"/")
}
func writeExclude(repo *gitrepo.Repo, rules Rules) error {
file := filepath.Join(repo.CommonDir, "info", "exclude")
current, _ := os.ReadFile(file)