Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions denops/gin/git/finder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@
"--show-superproject-working-tree",
]);
} catch (e) {
result = e as Error;
if (e instanceof Error) {
result = e;
} else {
throw e;
}

Check warning on line 53 in denops/gin/git/finder.ts

View check run for this annotation

Codecov / codecov/patch

denops/gin/git/finder.ts#L52-L53

Added lines #L52 - L53 were not covered by tests
}
cacheWorktree.set(path, result);
return result;
Expand All @@ -70,7 +74,11 @@
try {
result = await revParse(path, ["--git-dir"]);
} catch (e) {
result = e as Error;
if (e instanceof Error) {
result = e;
} else {
throw e;
}

Check warning on line 81 in denops/gin/git/finder.ts

View check run for this annotation

Codecov / codecov/patch

denops/gin/git/finder.ts#L80-L81

Added lines #L80 - L81 were not covered by tests
}
cacheGitdir.set(path, result);
return result;
Expand Down Expand Up @@ -99,5 +107,5 @@
async function revParse(cwd: string, args: string[]): Promise<string> {
const stdout = await execute(["rev-parse", ...args], { cwd });
const output = decodeUtf8(stdout);
return resolve(output.split(/\n/, 2)[0]);
return resolve(cwd, output.split(/\n/, 2)[0]);
}