Fix keep history (#27)
This commit is contained in:
parent
6b68dc4210
commit
41ad18c22f
|
@ -58,7 +58,7 @@ function run() {
|
||||||
process.chdir(tmpdir);
|
process.chdir(tmpdir);
|
||||||
const remote_branch_exists = child_process.execSync(`git ls-remote --heads ${remote_url} ${target_branch}`, { encoding: 'utf8' }).trim().length >
|
const remote_branch_exists = child_process.execSync(`git ls-remote --heads ${remote_url} ${target_branch}`, { encoding: 'utf8' }).trim().length >
|
||||||
0;
|
0;
|
||||||
if (remote_branch_exists) {
|
if (keep_history && remote_branch_exists) {
|
||||||
yield exec.exec('git', ['clone', '--quiet', '--branch', target_branch, '--depth', '1', remote_url, '.']);
|
yield exec.exec('git', ['clone', '--quiet', '--branch', target_branch, '--depth', '1', remote_url, '.']);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -43,7 +43,7 @@ async function run() {
|
||||||
const remote_branch_exists =
|
const remote_branch_exists =
|
||||||
child_process.execSync(`git ls-remote --heads ${remote_url} ${target_branch}`, {encoding: 'utf8'}).trim().length >
|
child_process.execSync(`git ls-remote --heads ${remote_url} ${target_branch}`, {encoding: 'utf8'}).trim().length >
|
||||||
0;
|
0;
|
||||||
if (remote_branch_exists) {
|
if (keep_history && remote_branch_exists) {
|
||||||
await exec.exec('git', ['clone', '--quiet', '--branch', target_branch, '--depth', '1', remote_url, '.']);
|
await exec.exec('git', ['clone', '--quiet', '--branch', target_branch, '--depth', '1', remote_url, '.']);
|
||||||
} else {
|
} else {
|
||||||
core.info(`🏃 Initializing local git repo`);
|
core.info(`🏃 Initializing local git repo`);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user