{"draft":null,"from":62,"to":63,"files":[{"path":"client/test/client.test.ts","added":24,"removed":1,"diff":"--- a/client/test/client.test.ts\n+++ b/client/test/client.test.ts\n@@ -525,7 +525,7 @@\n \t\tgit(\"init\", \"-q\");\n \t\tgit(\"config\", \"core.autocrlf\", \"false\");\n \t\twrite(bob, { \".gitattributes\": \"*.txt eol=crlf\\n*.bin -text\\n\" });\n-\t\tassert.equal((await avcs(bob, \"join\", name, \"--agent\", \"bob\", \"--server\", fake.url)).exit, 0);\n+\t\tassert.equal((await avcs(bob, \"join\", name, \"--agent\", \"bob\", \"--server\", fake.url, \"--dir\", \".\")).exit, 0);\n \t\twrite(folders.alice!, { \"a.txt\": \"one\\ntwo\\n\", \"b.md\": \"one\\ntwo\\n\", \"c.bin\": \"x\\ny\\n\" });\n \t\tassert.equal((await avcs(folders.alice!, \"publish\", \"-m\", \"three files\")).exit, 0);\n \t\tassert.equal((await avcs(bob, \"sync\")).exit, 0);\n@@ -2542,6 +2542,29 @@\n \t\tassert.doesNotMatch(without.stdout, /Nothing is installed/);\n \t});\n \n+\tit(\"join writes here when this folder is empty, else into ./<project>, never over someone's files (abso issue 351)\", async () => {\n+\t\tconst { name } = await project({ \"a.ts\": \"one\\n\" }, \"alice\");\n+\t\tconst run = (cwd: string, agent: string) =>\n+\t\t\tmain([\"join\", name, \"--agent\", agent, \"--server\", fake.url], { cwd, env: ENV, write: () => {} });\n+\t\tconst empty = temp();\n+\t\tconst here = await run(empty, \"bob\");\n+\t\tassert.equal(here.exit, 0, here.stderr);\n+\t\tassert.equal(read(empty, \"a.ts\"), \"one\\n\", \"an empty folder: here\");\n+\t\tassert.doesNotMatch(here.stdout, /^cd /m);\n+\t\tconst busy = temp();\n+\t\twrite(busy, { \"notes.md\": \"mine\\n\" });\n+\t\tconst sub = await run(busy, \"carol\");\n+\t\tassert.equal(sub.exit, 0, sub.stderr);\n+\t\tassert.equal(read(join(busy, name), \"a.ts\"), \"one\\n\", \"a folder with files in it: ./<project>\");\n+\t\tassert.equal(read(busy, \"notes.md\"), \"mine\\n\");\n+\t\tassert.match(sub.stdout, new RegExp(`^cd ${name}$`, \"m\"));\n+\t\tconst taken = temp();\n+\t\twrite(taken, { \"notes.md\": \"mine\\n\", [`${name}/other.md`]: \"theirs\\n\" });\n+\t\tconst refused = await run(taken, \"dave\");\n+\t\tassert.notEqual(refused.exit, 0);\n+\t\tassert.match(refused.stderr, /already has files in it: say where to join with --dir <folder>/);\n+\t});\n+\n \tit(\"gives a call more time by what it sends: 1 s per 100 KB over the base (abso issue 34)\", () => {\n \t\tassert.equal(timeoutFor(30_000, undefined), 30_000);\n \t\tassert.equal(timeoutFor(30_000, \"{}\"), 30_000);"}],"unmatched":[]}