Refactor code to use our custom Git class

This commit is contained in:
Alex Gleason committed 2025-09-14 16:26:37 -05:00
1 parent 55120452c7
commit 772a2f424b
9 files changed
+93 -123

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
import { useMemo } from 'react';
import { Git } from '@/lib/git';
import { useFS } from '@/hooks/useFS';
/**
* Hook that provides a Git instance configured with the virtual filesystem
* and appropriate CORS proxy for GitHub/GitLab repositories.
*/
export function useGit() {
const { fs } = useFS();
const git = useMemo(() => {
return new Git(fs, 'https://cors.isomorphic-git.org');
}, [fs]);
return git;
}