mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-03 06:51:53 +01:00
Git - add setting to control default branch name (#181884)
* Initial implementation * Refactor based on discussions * More pull request feedback
This commit is contained in:
@@ -401,9 +401,14 @@ export class Git {
|
||||
return new Repository(this, repository, dotGit, logger);
|
||||
}
|
||||
|
||||
async init(repository: string): Promise<void> {
|
||||
await this.exec(repository, ['init']);
|
||||
return;
|
||||
async init(repository: string, options: { defaultBranch?: string } = {}): Promise<void> {
|
||||
const args = ['init'];
|
||||
|
||||
if (options.defaultBranch && options.defaultBranch !== '') {
|
||||
args.push('-b', options.defaultBranch);
|
||||
}
|
||||
|
||||
await this.exec(repository, args);
|
||||
}
|
||||
|
||||
async clone(url: string, options: ICloneOptions, cancellationToken?: CancellationToken): Promise<string> {
|
||||
|
||||
Reference in New Issue
Block a user