mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2026-01-30 04:11:33 -08:00
feat: make getModifiedFileList async
This commit is contained in:
parent
4ec209096a
commit
f73645a352
2 changed files with 5 additions and 6 deletions
|
|
@ -2,7 +2,7 @@
|
|||
import 'source-map-support/register';
|
||||
import { expose } from 'threads/worker';
|
||||
import { Observable } from 'rxjs';
|
||||
import { clone, commitAndSync, GitStep, ILoggerContext, initGit } from 'git-sync-js';
|
||||
import { clone, commitAndSync, GitStep, ILoggerContext, initGit, getModifiedFileList, getRemoteUrl } from 'git-sync-js';
|
||||
import { IGitLogMessage, IGitUserInfos } from './interface';
|
||||
import { defaultGitInfo } from './defaultGitInfo';
|
||||
import { WikiChannel } from '@/constants/channels';
|
||||
|
|
@ -81,6 +81,6 @@ function cloneWiki(repoFolderPath: string, remoteUrl: string, userInfo: IGitUser
|
|||
});
|
||||
}
|
||||
|
||||
const gitWorker = { initWikiGit, commitAndSyncWiki, cloneWiki };
|
||||
const gitWorker = { initWikiGit, commitAndSyncWiki, cloneWiki, getModifiedFileList, getRemoteUrl };
|
||||
export type GitWorker = typeof gitWorker;
|
||||
expose(gitWorker);
|
||||
|
|
|
|||
|
|
@ -5,8 +5,6 @@ import {
|
|||
AssumeSyncError,
|
||||
CantSyncGitNotInitializedError,
|
||||
CantSyncInSpecialGitStateAutoFixFailed,
|
||||
getModifiedFileList,
|
||||
getRemoteUrl,
|
||||
GitPullPushError,
|
||||
GitStep,
|
||||
ModifiedFileList,
|
||||
|
|
@ -55,12 +53,13 @@ export class Git implements IGitService {
|
|||
|
||||
public async getWorkspacesRemote(wikiFolderPath: string): Promise<string | undefined> {
|
||||
if (await hasGit(wikiFolderPath)) {
|
||||
return await getRemoteUrl(wikiFolderPath);
|
||||
return await this.gitWorker?.getRemoteUrl(wikiFolderPath);
|
||||
}
|
||||
}
|
||||
|
||||
public async getModifiedFileList(wikiFolderPath: string): Promise<ModifiedFileList[]> {
|
||||
return await getModifiedFileList(wikiFolderPath);
|
||||
const list = await this.gitWorker?.getModifiedFileList(wikiFolderPath);
|
||||
return list ?? [];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue