From cae0209fe093e20ee86aa15c03cb27ebe00f14a2 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Tue, 14 Nov 2023 08:52:36 +0300 Subject: [PATCH] check oid --- apps/remix-ide/src/app/files/dgitProvider.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide/src/app/files/dgitProvider.js b/apps/remix-ide/src/app/files/dgitProvider.js index 40c0cb1b6c..05be292244 100644 --- a/apps/remix-ide/src/app/files/dgitProvider.js +++ b/apps/remix-ide/src/app/files/dgitProvider.js @@ -386,13 +386,22 @@ class DGitProvider extends Plugin { ref: result[0] }) - await git.checkout({ ...await this.getGitConfig(dir), ref: result[0] }) - this.call('terminal', 'logHtml',`Checked out submodule ${dir} to ${result[0]}`) + const log = await git.log({ + ...await this.getGitConfig(dir), + }) + + if(log[0].oid !== result[0]) { + this.call('terminal', 'log', { + type: 'error', + value: `Could not checkout submodule to ${result[0]}` + })} else { + this.call('terminal', 'logHtml',`Checked out submodule ${dir} to ${result[0]}`) + } } await this.updateSubmodules({