diff --git a/src/cml.js b/src/cml.js index 4883848eb9..0f9b74804e 100755 --- a/src/cml.js +++ b/src/cml.js @@ -337,13 +337,9 @@ class CML { } = opts; const driver = getDriver(this); - const command = await driver.updateGitConfig({ userName, userEmail }); - await exec(command); - if (unshallow) { - if ((await exec('git rev-parse --is-shallow-repository')) === 'true') { - await exec('git fetch --unshallow'); - } - } + const shallow = await exec('git rev-parse --is-shallow-repository'); + if (unshallow && shallow === 'true') await exec('git fetch --unshallow'); + await exec(await driver.updateGitConfig({ userName, userEmail })); await exec('git fetch --all'); }