From cb461881c8b7339859f45928f9313437fbc5c78d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Chmiela?= Date: Mon, 10 Feb 2025 18:13:36 +0100 Subject: [PATCH] Do not include files deleted in working directory --- packages/eas-cli/src/vcs/clients/git.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/eas-cli/src/vcs/clients/git.ts b/packages/eas-cli/src/vcs/clients/git.ts index b99b120ebf..eebc064a02 100644 --- a/packages/eas-cli/src/vcs/clients/git.ts +++ b/packages/eas-cli/src/vcs/clients/git.ts @@ -182,7 +182,19 @@ export default class GitClient extends Client { await setGitCaseSensitivityAsync(true, rootPath); await spawnAsync( 'git', - ['clone', '--no-hardlinks', '--depth', '1', gitRepoUri, destinationPath], + [ + 'clone', + // If we do not require a commit, we are going to later + // copy the working directory into the destination path, + // so we can skip the checkout step (which also adds files + // that have been removed in the working directory). + this.requireCommit ? null : '--no-checkout', + '--no-hardlinks', + '--depth', + '1', + gitRepoUri, + destinationPath, + ].flatMap(e => e ?? []), { cwd: rootPath } );