| 126 | } |
| 127 | |
| 128 | async fetch( |
| 129 | refSpec: string[], |
| 130 | remoteName?: string, |
| 131 | options?: string[], |
| 132 | unshallow = false |
| 133 | ): Promise<void> { |
| 134 | const args = ['-c', 'protocol.version=2', 'fetch'] |
| 135 | if (!refSpec.some(x => x === tagsRefSpec)) { |
| 136 | args.push('--no-tags') |
| 137 | } |
| 138 | |
| 139 | args.push('--progress', '--no-recurse-submodules') |
| 140 | |
| 141 | if ( |
| 142 | unshallow && |
| 143 | utils.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow')) |
| 144 | ) { |
| 145 | args.push('--unshallow') |
| 146 | } |
| 147 | |
| 148 | if (options) { |
| 149 | args.push(...options) |
| 150 | } |
| 151 | |
| 152 | if (remoteName) { |
| 153 | args.push(remoteName) |
| 154 | } else { |
| 155 | args.push('origin') |
| 156 | } |
| 157 | for (const arg of refSpec) { |
| 158 | args.push(arg) |
| 159 | } |
| 160 | |
| 161 | await this.exec(args) |
| 162 | } |
| 163 | |
| 164 | async getCommit(ref: string): Promise<Commit> { |
| 165 | const endOfBody = '###EOB###' |