update git.listfiles to list files in .insomnia directory (#5683)

* update git.listfiles to list files in .insomnia directory

* filter git.listfiles result instead of function call

* Update packages/insomnia/src/sync/git/git-vcs.ts with cleanup suggestions

Co-authored-by: James Gatz <jamesgatzos@gmail.com>

* fix lint

Co-authored-by: Patrick Murrell <pmurrell@lcs.com>
Co-authored-by: James Gatz <jamesgatzos@gmail.com>
Co-authored-by: Filipe Freire <livrofubia@gmail.com>
This commit is contained in:
PatrickMurrell 2023-01-24 04:38:37 -05:00 committed by GitHub
parent 7417acb7b9
commit 18defb5719
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -146,8 +146,9 @@ export class GitVCS {
async listFiles() {
console.log('[git] List files');
const files = await git.listFiles({ ...this._baseOpts });
return files.map(convertToOsSep);
const repositoryFiles = await git.listFiles({ ...this._baseOpts });
const insomniaFiles = repositoryFiles.filter(file => file.startsWith(GIT_INSOMNIA_DIR_NAME)).map(convertToOsSep);
return insomniaFiles;
}
async getBranch() {