Skip to content

Commit e110f19

Browse files
committed
Fix test
1 parent 8971ab4 commit e110f19

2 files changed

Lines changed: 1 addition & 28 deletions

File tree

src/git.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ async function findGitRoot(cwd: string): Promise<string> {
143143
throwOnError: true,
144144
nodeOptions: { cwd },
145145
});
146-
return path.resolve(cwd, stdout.trim());
146+
return path.dirname(path.resolve(cwd, stdout.trim()));
147147
} catch {
148148
return cwd;
149149
}

tests/git.test.ts

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -165,33 +165,6 @@ describe("getFileChanges", () => {
165165
});
166166
});
167167

168-
it("should filter files when running in a repository sub-directory", async () => {
169-
await using fixture = await createFixture({
170-
"foo.txt": "Hello, world!",
171-
"nested/foo.txt": "Hello, world!",
172-
});
173-
await setupGit(fixture.path);
174-
175-
await fixture.rm("foo.txt");
176-
await fixture.rm("nested/foo.txt");
177-
await fixture.writeFile("bar.txt", "This is a new file!");
178-
await fixture.writeFile("nested/bar.txt", "This is a new file!");
179-
180-
const result = await getFileChanges(
181-
path.join(fixture.path, "nested"),
182-
"HEAD",
183-
);
184-
expect(result).toEqual({
185-
additions: [
186-
{
187-
path: "nested/bar.txt",
188-
contents: await fixture.readFile("nested/bar.txt", "base64"),
189-
},
190-
],
191-
deletions: [{ path: "nested/foo.txt" }],
192-
});
193-
});
194-
195168
it("should allow existing symlinks", async () => {
196169
await using fixture = await createFixture({
197170
"foo.txt": "Hello, world!",

0 commit comments

Comments
 (0)