Skip to content
Open
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
9 changes: 6 additions & 3 deletions apps/server/src/git/Utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { existsSync } from "node:fs";
import { join } from "node:path";
import { dirname, join } from "node:path";

export function isGitRepository(cwd: string): boolean {
return existsSync(join(cwd, ".git"));
export function isGitRepository(current: string): boolean {
do {
if (existsSync(join(current, ".git"))) return true;
} while (current !== (current = dirname(current)));
return false;
}
Comment thread
macroscopeapp[bot] marked this conversation as resolved.
Loading