Skip to content

Commit 3c46455

Browse files
committed
fix: remove execa timeout
1 parent dff0a34 commit 3c46455

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

lib/git.js

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
const execa = require('execa');
22
const debug = require('debug')('semantic-release:git');
3-
const envCi = require('env-ci');
4-
5-
const timeout = envCi().isCi ? 10000 : 0;
63

74
/**
85
* Get the commit sha for a given tag.
@@ -13,7 +10,7 @@ const timeout = envCi().isCi ? 10000 : 0;
1310
*/
1411
async function gitTagHead(tagName) {
1512
try {
16-
return await execa.stdout('git', ['rev-list', '-1', tagName], {timeout});
13+
return await execa.stdout('git', ['rev-list', '-1', tagName]);
1714
} catch (err) {
1815
debug(err);
1916
}
@@ -24,7 +21,7 @@ async function gitTagHead(tagName) {
2421
* @throws {Error} If the `git` command fails.
2522
*/
2623
async function gitTags() {
27-
return (await execa.stdout('git', ['tag'], {timeout}))
24+
return (await execa.stdout('git', ['tag']))
2825
.split('\n')
2926
.map(tag => tag.trim())
3027
.filter(tag => Boolean(tag));
@@ -39,7 +36,7 @@ async function gitTags() {
3936
*/
4037
async function isRefInHistory(ref) {
4138
try {
42-
return (await execa('git', ['merge-base', '--is-ancestor', ref, 'HEAD'], {timeout})).code === 0;
39+
return (await execa('git', ['merge-base', '--is-ancestor', ref, 'HEAD'])).code === 0;
4340
} catch (err) {
4441
debug(err);
4542
}
@@ -49,22 +46,22 @@ async function isRefInHistory(ref) {
4946
* Unshallow the git repository (retriving every commits and tags).
5047
*/
5148
async function unshallow() {
52-
await execa('git', ['fetch', '--unshallow', '--tags'], {reject: false, timeout});
49+
await execa('git', ['fetch', '--unshallow', '--tags'], {reject: false});
5350
}
5451

5552
/**
5653
* @return {string} the sha of the HEAD commit.
5754
*/
5855
async function gitHead() {
59-
return execa.stdout('git', ['rev-parse', 'HEAD'], {timeout});
56+
return execa.stdout('git', ['rev-parse', 'HEAD']);
6057
}
6158

6259
/**
6360
* @return {string} The value of the remote git URL.
6461
*/
6562
async function repoUrl() {
6663
try {
67-
return await execa.stdout('git', ['remote', 'get-url', 'origin'], {timeout});
64+
return await execa.stdout('git', ['remote', 'get-url', 'origin']);
6865
} catch (err) {
6966
debug(err);
7067
}
@@ -75,7 +72,7 @@ async function repoUrl() {
7572
*/
7673
async function isGitRepo() {
7774
try {
78-
return (await execa('git', ['rev-parse', '--git-dir'], {timeout})).code === 0;
75+
return (await execa('git', ['rev-parse', '--git-dir'])).code === 0;
7976
} catch (err) {
8077
debug(err);
8178
}
@@ -91,7 +88,7 @@ async function isGitRepo() {
9188
*/
9289
async function verifyAuth(origin, branch) {
9390
try {
94-
return (await execa('git', ['push', '--dry-run', origin, `HEAD:${branch}`], {timeout})).code === 0;
91+
return (await execa('git', ['push', '--dry-run', origin, `HEAD:${branch}`])).code === 0;
9592
} catch (err) {
9693
debug(err);
9794
}
@@ -104,7 +101,7 @@ async function verifyAuth(origin, branch) {
104101
* @throws {Error} if the tag creation failed.
105102
*/
106103
async function tag(tagName) {
107-
await execa('git', ['tag', tagName], {timeout});
104+
await execa('git', ['tag', tagName]);
108105
}
109106

110107
/**
@@ -115,7 +112,7 @@ async function tag(tagName) {
115112
* @throws {Error} if the push failed.
116113
*/
117114
async function push(origin, branch) {
118-
await execa('git', ['push', '--tags', origin, `HEAD:${branch}`], {timeout});
115+
await execa('git', ['push', '--tags', origin, `HEAD:${branch}`]);
119116
}
120117

121118
/**
@@ -126,7 +123,7 @@ async function push(origin, branch) {
126123
*/
127124
async function verifyTagName(tagName) {
128125
try {
129-
return (await execa('git', ['check-ref-format', `refs/tags/${tagName}`], {timeout})).code === 0;
126+
return (await execa('git', ['check-ref-format', `refs/tags/${tagName}`])).code === 0;
130127
} catch (err) {
131128
debug(err);
132129
}

0 commit comments

Comments
 (0)