diff --git a/lib/session.js b/lib/session.js index c6bba9a6..59025af1 100644 --- a/lib/session.js +++ b/lib/session.js @@ -347,7 +347,8 @@ export default class Session { const { cli, upstream, branch } = this; const branchName = `${upstream}/${branch}`; cli.startSpinner(`Bringing ${branchName} up to date...`); - await runAsync('git', ['fetch', upstream, branch]); + const maybeUnshallow = fs.existsSync('.git/shallow') ? ['--unshallow'] : []; + await runAsync('git', ['fetch', ...maybeUnshallow, upstream, branch]); cli.stopSpinner(`${branchName} is now up-to-date`); const stray = this.getStrayCommits(true); if (!stray.length) {