feat(client): lodge remote binds a repository to another server

This commit is contained in:
hh committed 2026-10-02 22:05:10 +00:00
1 parent 45c81cfcaf
commit 91d83f3032
10 files changed
+639 -147

No files matched your search

+6 -6
View File
@@ -17,7 +17,7 @@ func TestDaemonWatchesOnlyRulePaths(t *testing.T) {
t.Fatal(err)
}
t.Cleanup(func() { watcher.Close() })
d := &daemon{client: m.client, watcher: watcher, owners: map[string]string{}, trees: map[string]tree{}}
d := &daemon{config: m.config, watcher: watcher, owners: map[string]string{}, trees: map[string]tree{}}
gitDir := filepath.Join(m.root, ".git")
expectWatched := func(want ...string) {
t.Helper()
@@ -62,7 +62,7 @@ func TestDaemonSkipsIgnoredPaths(t *testing.T) {
t.Fatal(err)
}
t.Cleanup(func() { watcher.Close() })
d := &daemon{client: m.client, watcher: watcher, owners: map[string]string{}, trees: map[string]tree{}}
d := &daemon{config: m.config, watcher: watcher, owners: map[string]string{}, trees: map[string]tree{}}
write(t, m.root, RulesFile, "shared vault\nignore vault/.obsidian/workspace*.json\nignore .DS_Store\nignore vault/.trash\n")
write(t, m.root, "vault/.obsidian/app.json", "settings")
write(t, m.root, "vault/.trash/old.md", "old")
@@ -85,13 +85,13 @@ func TestDaemonSkipsIgnoredPaths(t *testing.T) {
}
func TestDaemonForgetsVanishedWorktrees(t *testing.T) {
c := &Client{DataDir: t.TempDir()}
if err := writeJSONFile(c.registryPath(), []string{filepath.Join(t.TempDir(), "gone")}); err != nil {
cfg := &Config{DataDir: t.TempDir()}
if err := writeJSONFile(cfg.registryPath(), []string{filepath.Join(t.TempDir(), "gone")}); err != nil {
t.Fatal(err)
}
d := &daemon{client: c, owners: map[string]string{}, trees: map[string]tree{}}
d := &daemon{config: cfg, owners: map[string]string{}, trees: map[string]tree{}}
d.syncAll()
if roots := c.Worktrees(); len(roots) != 0 {
if roots := cfg.Worktrees(); len(roots) != 0 {
t.Fatalf("registry still lists %v", roots)
}
}