Skip to content

Commit 41ad18c

Browse files
committed
Fix keep history (#27)
1 parent 6b68dc4 commit 41ad18c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function run() {
5858
process.chdir(tmpdir);
5959
const remote_branch_exists = child_process.execSync(`git ls-remote --heads ${remote_url} ${target_branch}`, { encoding: 'utf8' }).trim().length >
6060
0;
61-
if (remote_branch_exists) {
61+
if (keep_history && remote_branch_exists) {
6262
yield exec.exec('git', ['clone', '--quiet', '--branch', target_branch, '--depth', '1', remote_url, '.']);
6363
}
6464
else {

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ async function run() {
4343
const remote_branch_exists =
4444
child_process.execSync(`git ls-remote --heads ${remote_url} ${target_branch}`, {encoding: 'utf8'}).trim().length >
4545
0;
46-
if (remote_branch_exists) {
46+
if (keep_history && remote_branch_exists) {
4747
await exec.exec('git', ['clone', '--quiet', '--branch', target_branch, '--depth', '1', remote_url, '.']);
4848
} else {
4949
core.info(`🏃 Initializing local git repo`);

0 commit comments

Comments
 (0)