respect gitignore in toes status

This commit is contained in:
Chris Wanstrath 2026-02-11 18:16:31 -08:00
parent c183fe42e9
commit 10154dfd4f

View File

@ -158,10 +158,11 @@ export async function pushApp(options: { quiet?: boolean } = {}) {
}
}
// Files to delete (exist on server but not locally)
// Files to delete (exist on server but not locally, respecting gitignore)
const gitignore = loadGitignore(process.cwd())
const toDelete: string[] = []
for (const file of remoteFiles) {
if (!localFiles.has(file)) {
if (!localFiles.has(file) && !gitignore.shouldExclude(file)) {
toDelete.push(file)
}
}
@ -1008,10 +1009,11 @@ async function getManifestDiff(appName: string): Promise<ManifestDiff | null> {
}
}
// Files only in remote
// Files only in remote (filtered by local gitignore)
const gitignore = loadGitignore(process.cwd())
const remoteOnly: string[] = []
for (const file of remoteFiles) {
if (!localFiles.has(file)) {
if (!localFiles.has(file) && !gitignore.shouldExclude(file)) {
remoteOnly.push(file)
}
}