mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-02 14:31:31 +01:00
git: getBranch should resolve @ name syntax
This commit is contained in:
@@ -1429,6 +1429,10 @@ export class Repository {
|
||||
async getBranch(name: string): Promise<Branch> {
|
||||
if (name === 'HEAD') {
|
||||
return this.getHEAD();
|
||||
} else if (/^@/.test(name)) {
|
||||
const symbolicFullNameResult = await this.run(['rev-parse', '--symbolic-full-name', name]);
|
||||
const symbolicFullName = symbolicFullNameResult.stdout.trim();
|
||||
name = symbolicFullName || name;
|
||||
}
|
||||
|
||||
const result = await this.run(['rev-parse', name]);
|
||||
|
||||
Reference in New Issue
Block a user