From 41ad18c22f11d06df63c9bec82c600a9789d2d0e Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Tue, 19 Nov 2019 13:15:27 +0100 Subject: [PATCH] Fix keep history (#27) --- lib/main.js | 2 +- src/main.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/main.js b/lib/main.js index ce03844..25eb905 100644 --- a/lib/main.js +++ b/lib/main.js @@ -58,7 +58,7 @@ function run() { process.chdir(tmpdir); const remote_branch_exists = child_process.execSync(`git ls-remote --heads ${remote_url} ${target_branch}`, { encoding: 'utf8' }).trim().length > 0; - if (remote_branch_exists) { + if (keep_history && remote_branch_exists) { yield exec.exec('git', ['clone', '--quiet', '--branch', target_branch, '--depth', '1', remote_url, '.']); } else { diff --git a/src/main.ts b/src/main.ts index f860718..f065b0a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -43,7 +43,7 @@ async function run() { const remote_branch_exists = child_process.execSync(`git ls-remote --heads ${remote_url} ${target_branch}`, {encoding: 'utf8'}).trim().length > 0; - if (remote_branch_exists) { + if (keep_history && remote_branch_exists) { await exec.exec('git', ['clone', '--quiet', '--branch', target_branch, '--depth', '1', remote_url, '.']); } else { core.info(`🏃 Initializing local git repo`);