fix: check git before get git

This commit is contained in:
tiddlygit-test 2021-05-04 20:04:34 +08:00
parent c9a34b8a8f
commit 2bb6831bae
3 changed files with 6 additions and 5 deletions

View file

@ -47,8 +47,10 @@ export class Git implements IGitService {
public debounceCommitAndSync: (wikiFolderPath: string, remoteUrl: string, userInfo: IGitUserInfos) => Promise<void> | undefined;
public async getWorkspacesRemote(wikiFolderPath: string): Promise<string> {
return await getRemoteUrl(wikiFolderPath);
public async getWorkspacesRemote(wikiFolderPath: string): Promise<string | undefined> {
if (await hasGit(wikiFolderPath)) {
return await getRemoteUrl(wikiFolderPath);
}
}
public async getModifiedFileList(wikiFolderPath: string): Promise<ModifiedFileList[]> {