diff --git a/lib/setup-repository.js b/lib/setup-repository.js index de4e5f0..756bfef 100644 --- a/lib/setup-repository.js +++ b/lib/setup-repository.js @@ -41,10 +41,7 @@ module.exports = async (path, repoUrl, options = {}) => { const { stdoutBuffer } = await runProgram("git", ["status"], { cwd: path }); const localStatus = String(stdoutBuffer); - if ( - tryPull && - (localStatus.includes("Your branch is behind") || localStatus.includes("have diverged")) - ) { + if (tryPull && localStatus.includes("Your branch is behind")) { await runProgram("git", ["merge", "FETCH_HEAD"], { cwd: path, logger: log.levelRoot.get("git:merge") @@ -52,10 +49,7 @@ module.exports = async (path, repoUrl, options = {}) => { report.add("pull"); } - if ( - tryPush && - (localStatus.includes("Your branch is ahead") || localStatus.includes("have diverged")) - ) { + if (tryPush && localStatus.includes("Your branch is ahead")) { await runProgram("git", ["push"], { cwd: path, logger: log.levelRoot.get("git:push") }); report.add("push"); }