Skip to content

Commit 18bba03

Browse files
committed
Minor improvements to .worktreeinclude support implementation
1 parent 53f844c commit 18bba03

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

app/src/lib/git/worktree-include.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import * as Fs from 'fs'
21
import * as Path from 'path'
32
import { readFile, copyFile, mkdir } from 'fs/promises'
43
import ignore from 'ignore'
54
import type { Repository } from '../../models/repository'
5+
import { pathExists } from '../../ui/lib/path-exists'
66
import { git } from './core'
77
import { addWorktree, getMainWorktreePath } from './worktree'
88

@@ -59,7 +59,7 @@ export async function getIgnoredFilesMatchingPatterns(
5959
// Files are NUL-separated; filter out empty entries from the split
6060
const ignoredFiles = result.stdout.split('\0').filter(f => f.length > 0)
6161

62-
const ig = ignore().add(patterns as string[])
62+
const ig = ignore().add(patterns)
6363
return ignoredFiles.filter(f => ig.ignores(f))
6464
}
6565

@@ -89,8 +89,8 @@ export async function copyWorktreeIncludeFiles(
8989
}
9090

9191
try {
92-
// eslint-disable-next-line no-sync
93-
if (!Fs.existsSync(src)) {
92+
const exists = await pathExists(dest)
93+
if (!exists) {
9494
continue
9595
}
9696

0 commit comments

Comments
 (0)