@@ -370,10 +370,7 @@ async function assertBranchOnOrigin(context: string): Promise<void> {
370370 * the GitRepository document should pass `directory` to avoid a DB lookup;
371371 * otherwise the directory is resolved from the database by id.
372372 */
373- async function getRepoBaseDir (
374- gitRepositoryId : string ,
375- directory ?: string | null ,
376- ) : Promise < string > {
373+ async function getRepoBaseDir ( gitRepositoryId : string , directory ?: string | null ) : Promise < string > {
377374 let dir = directory ;
378375 if ( dir === undefined ) {
379376 const repo = await services . gitRepository . getById ( gitRepositoryId ) ;
@@ -395,8 +392,7 @@ async function getRepoBaseDir(
395392 *
396393 * Insomnia owns the app-managed location (`directory === null`). A user-chosen
397394 * `directory` belongs to the user and must never be deleted when the project is
398- * removed (decision D4 in GIT_LOCAL_REPOS_DESIGN.md). Failures are logged, not
399- * thrown — losing a project record should not be blocked by a stale folder.
395+ * removed. Failures are logged, not thrown — losing a project record should not be blocked by a stale folder.
400396 */
401397async function deleteManagedRepoFolderIfOwned ( repo : Pick < GitRepository , '_id' | 'directory' > ) {
402398 if ( repo . directory ) {
@@ -595,7 +591,12 @@ export async function loadGitRepository({ projectId, workspaceId }: { projectId:
595591 }
596592
597593 const bufferId = await database . bufferChanges ( ) ;
598- const fsClient = await getGitFSClient ( { gitRepositoryId : gitRepository . _id , projectId, workspaceId, directory : gitRepository . directory } ) ;
594+ const fsClient = await getGitFSClient ( {
595+ gitRepositoryId : gitRepository . _id ,
596+ projectId,
597+ workspaceId,
598+ directory : gitRepository . directory ,
599+ } ) ;
599600
600601 if ( GitVCS . isInitializedForRepo ( gitRepository . _id ) && ! gitRepository . needsFullClone ) {
601602 let legacyInsomniaWorkspace ;
@@ -1171,7 +1172,7 @@ export const cloneGitRepoAction = async ({
11711172 selectedAuthorEmail ?: string | null ;
11721173 /**
11731174 * Optional absolute path to a user-chosen folder to clone into. When omitted,
1174- * the repository is stored in the app-managed location. See GIT_LOCAL_REPOS_DESIGN.md.
1175+ * the repository is stored in the app-managed location.
11751176 */
11761177 directory ?: string | null ;
11771178} ) => {
@@ -1295,7 +1296,11 @@ export const cloneGitRepoAction = async ({
12951296
12961297 const project = await getProject ( ) ;
12971298
1298- const fsClient = await getGitFSClient ( { projectId : project . _id , gitRepositoryId : gitRepository . _id , directory : gitRepository . directory } ) ;
1299+ const fsClient = await getGitFSClient ( {
1300+ projectId : project . _id ,
1301+ gitRepositoryId : gitRepository . _id ,
1302+ directory : gitRepository . directory ,
1303+ } ) ;
12991304
13001305 if ( gitRepository . needsFullClone ) {
13011306 await GitVCS . initFromClone ( {
@@ -1567,7 +1572,7 @@ export const cloneGitRepoAction = async ({
15671572} ;
15681573
15691574/**
1570- * Open/adopt an existing local folder as a Git project. See GIT_LOCAL_REPOS_DESIGN.md.
1575+ * Open/adopt an existing local folder as a Git project.
15711576 *
15721577 * Unlike {@link cloneGitRepoAction} this performs no network clone — it points
15731578 * Insomnia at a folder already on disk:
@@ -1606,7 +1611,9 @@ export const openGitRepoAction = async ({
16061611 }
16071612 await fs . promises . access ( resolvedDirectory , fs . constants . R_OK | fs . constants . W_OK ) ;
16081613 } catch {
1609- return { errors : [ `Folder is not accessible (check it exists and you have read/write permission): ${ resolvedDirectory } ` ] } ;
1614+ return {
1615+ errors : [ `Folder is not accessible (check it exists and you have read/write permission): ${ resolvedDirectory } ` ] ,
1616+ } ;
16101617 }
16111618
16121619 // Hard-block if another project already owns this folder (OQ5).
@@ -1702,7 +1709,7 @@ export const openGitRepoAction = async ({
17021709 * Release a Git repository's runtime/disk resources when its project is being
17031710 * deleted (called from the renderer delete flow). Stops the file watcher and
17041711 * deletes the on-disk folder only when Insomnia owns it — user-chosen folders
1705- * are left untouched (decision D4 in GIT_LOCAL_REPOS_DESIGN.md) .
1712+ * are left untouched.
17061713 *
17071714 * The DB document removal stays in the renderer action so it participates in the
17081715 * same buffered change-set; this only handles the main-process-only concerns.
@@ -1719,7 +1726,7 @@ export const cleanupGitRepoStorageAction = async ({ gitRepositoryId }: { gitRepo
17191726
17201727/**
17211728 * Move a Git project's on-disk repository to a user-chosen folder and record the
1722- * new location on `GitRepository.directory`. See GIT_LOCAL_REPOS_DESIGN.md.
1729+ * new location on `GitRepository.directory`.
17231730 *
17241731 * The whole repository (working tree + `.git`) is moved, so history and
17251732 * uncommitted changes are preserved. If the previous location was the managed
@@ -3437,9 +3444,7 @@ export const registerGitServiceAPI = () => {
34373444 ipcMainHandle ( 'git.cloneGitRepo' , ( _ , options : Parameters < typeof cloneGitRepoAction > [ 0 ] ) =>
34383445 cloneGitRepoAction ( options ) ,
34393446 ) ;
3440- ipcMainHandle ( 'git.openGitRepo' , ( _ , options : Parameters < typeof openGitRepoAction > [ 0 ] ) =>
3441- openGitRepoAction ( options ) ,
3442- ) ;
3447+ ipcMainHandle ( 'git.openGitRepo' , ( _ , options : Parameters < typeof openGitRepoAction > [ 0 ] ) => openGitRepoAction ( options ) ) ;
34433448 ipcMainHandle ( 'git.cleanupGitRepoStorage' , ( _ , options : Parameters < typeof cleanupGitRepoStorageAction > [ 0 ] ) =>
34443449 cleanupGitRepoStorageAction ( options ) ,
34453450 ) ;
0 commit comments