mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 00:27:24 +00:00
Refactor code to use our custom Git class
This commit is contained in:
9 files changed
+93
-123
No files matched your search
@@ -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;
|
||||
}
|
||||
Reference in new issue
Block a user