Git - only add default branch name if supported (#185557)

This commit is contained in:
Ladislau Szomoru
2023-06-19 12:42:30 +02:00
committed by GitHub
parent b8a3395fed
commit 9b8f1cb437
3 changed files with 5 additions and 5 deletions

View File

@@ -404,7 +404,7 @@ export class Git {
async init(repository: string, options: InitOptions = {}): Promise<void> {
const args = ['init'];
if (options.defaultBranch && options.defaultBranch !== '') {
if (options.defaultBranch && options.defaultBranch !== '' && this.compareGitVersionTo('2.28.0') !== -1) {
args.push('-b', options.defaultBranch);
}