Fixed git plugin (#961)

main
Boris Sekachev 6 years ago committed by Nikita Manovich
parent 629b10a3db
commit e1c1a1b190

@ -11,7 +11,7 @@ interface GitPlugin {
Task: {
prototype: {
save: {
leave: (plugin: GitPlugin, task: any) => void;
leave: (plugin: GitPlugin, task: any) => Promise<any>;
};
};
};
@ -73,12 +73,12 @@ async function cloneRepository(
this: any,
plugin: GitPlugin,
createdTask: any,
): Promise<void> {
return new Promise((resolve, reject): void => {
): Promise<any> {
return new Promise((resolve, reject): any => {
if (typeof (this.id) !== 'undefined' || plugin.data.task !== this) {
// not the first save, we do not need to clone the repository
// or anchor set for another task
resolve();
resolve(createdTask);
} else if (plugin.data.repos) {
if (plugin.callbacks.onStatusChange) {
plugin.callbacks.onStatusChange('The repository is being cloned..');
@ -95,7 +95,7 @@ async function cloneRepository(
tid: createdTask.id,
}),
}).then(waitForClone).then((): void => {
resolve();
resolve(createdTask);
}).catch((error: any): void => {
createdTask.delete().finally((): void => {
reject(

Loading…
Cancel
Save