Skip to content

Commit

Permalink
Simplify conditionals
Browse files Browse the repository at this point in the history
  • Loading branch information
iterative-olivaw authored Apr 13, 2022
1 parent 114ff9f commit bed78e1
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/cml.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down

0 comments on commit bed78e1

Please sign in to comment.