Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions __test__/git-command-manager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ describe('Test fetchDepth and fetchTags options', () => {
[
'-c',
'protocol.version=2',
'-c',
'http.lowSpeedLimit=1000',
'-c',
'http.lowSpeedTime=15',
'fetch',
'--prune',
'--no-recurse-submodules',
Expand Down Expand Up @@ -170,6 +174,10 @@ describe('Test fetchDepth and fetchTags options', () => {
[
'-c',
'protocol.version=2',
'-c',
'http.lowSpeedLimit=1000',
'-c',
'http.lowSpeedTime=15',
'fetch',
'--no-tags',
'--prune',
Expand Down Expand Up @@ -208,6 +216,10 @@ describe('Test fetchDepth and fetchTags options', () => {
[
'-c',
'protocol.version=2',
'-c',
'http.lowSpeedLimit=1000',
'-c',
'http.lowSpeedTime=15',
'fetch',
'--no-tags',
'--prune',
Expand Down Expand Up @@ -247,6 +259,10 @@ describe('Test fetchDepth and fetchTags options', () => {
[
'-c',
'protocol.version=2',
'-c',
'http.lowSpeedLimit=1000',
'-c',
'http.lowSpeedTime=15',
'fetch',
'--prune',
'--no-recurse-submodules',
Expand Down Expand Up @@ -284,6 +300,10 @@ describe('Test fetchDepth and fetchTags options', () => {
[
'-c',
'protocol.version=2',
'-c',
'http.lowSpeedLimit=1000',
'-c',
'http.lowSpeedTime=15',
'fetch',
'--no-tags',
'--prune',
Expand Down Expand Up @@ -323,6 +343,10 @@ describe('Test fetchDepth and fetchTags options', () => {
[
'-c',
'protocol.version=2',
'-c',
'http.lowSpeedLimit=1000',
'-c',
'http.lowSpeedTime=15',
'fetch',
'--no-tags',
'--prune',
Expand Down Expand Up @@ -363,6 +387,10 @@ describe('Test fetchDepth and fetchTags options', () => {
[
'-c',
'protocol.version=2',
'-c',
'http.lowSpeedLimit=1000',
'-c',
'http.lowSpeedTime=15',
'fetch',
'--prune',
'--no-recurse-submodules',
Expand Down
13 changes: 11 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1559,7 +1559,15 @@ class GitCommandManager {
}
fetch(refSpec, options) {
return __awaiter(this, void 0, void 0, function* () {
const args = ['-c', 'protocol.version=2', 'fetch'];
const args = [
'-c',
'protocol.version=2',
'-c',
'http.lowSpeedLimit=1000',
'-c',
'http.lowSpeedTime=15',
'fetch'
];
if (!refSpec.some(x => x === refHelper.tagsRefSpec) && !options.fetchTags) {
args.push('--no-tags');
}
Expand All @@ -1581,7 +1589,8 @@ class GitCommandManager {
args.push(arg);
}
const that = this;
yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
const fetchRetryHelper = new retryHelper.RetryHelper(3, 1, 5);
yield fetchRetryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
yield that.execGit(args);
}));
});
Expand Down
13 changes: 11 additions & 2 deletions src/git-command-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,15 @@ class GitCommandManager {
showProgress?: boolean
}
): Promise<void> {
const args = ['-c', 'protocol.version=2', 'fetch']
const args = [
'-c',
'protocol.version=2',
'-c',
'http.lowSpeedLimit=1000',
'-c',
'http.lowSpeedTime=15',
'fetch'
]
if (!refSpec.some(x => x === refHelper.tagsRefSpec) && !options.fetchTags) {
args.push('--no-tags')
}
Expand Down Expand Up @@ -314,7 +322,8 @@ class GitCommandManager {
}

const that = this
await retryHelper.execute(async () => {
const fetchRetryHelper = new retryHelper.RetryHelper(3, 1, 5)
await fetchRetryHelper.execute(async () => {
await that.execGit(args)
})
}
Expand Down
Loading