Skip to content

Commit

Permalink
Fix keep history (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
crazy-max committed Nov 19, 2019
1 parent 6b68dc4 commit 41ad18c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
Expand Down

0 comments on commit 41ad18c

Please sign in to comment.