mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
Git - handle branch name with incorrect casing (#184502)
This commit is contained in:
parent
30092f40a3
commit
bb6d7d67ff
|
@ -12,7 +12,7 @@ import * as which from 'which';
|
|||
import { EventEmitter } from 'events';
|
||||
import * as iconv from '@vscode/iconv-lite-umd';
|
||||
import * as filetype from 'file-type';
|
||||
import { assign, groupBy, IDisposable, toDisposable, dispose, mkdirp, readBytes, detectUnicodeEncoding, Encoding, onceEvent, splitInChunks, Limiter, Versions, isWindows, pathEquals } from './util';
|
||||
import { assign, groupBy, IDisposable, toDisposable, dispose, mkdirp, readBytes, detectUnicodeEncoding, Encoding, onceEvent, splitInChunks, Limiter, Versions, isWindows, pathEquals, isMacintosh } from './util';
|
||||
import { CancellationError, CancellationToken, ConfigurationChangeEvent, LogOutputChannel, Progress, Uri, workspace } from 'vscode';
|
||||
import { detectEncoding } from './encoding';
|
||||
import { Ref, RefType, Branch, Remote, ForcePushMode, GitErrorCodes, LogOptions, Change, Status, CommitOptions, RefQuery, InitOptions } from './api/git';
|
||||
|
@ -2352,6 +2352,13 @@ export class Repository {
|
|||
args.push('--format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref)');
|
||||
}
|
||||
|
||||
// On Windows and macOS ref names are case insensitive so we add --ignore-case
|
||||
// to handle the scenario where the user switched to a branch with incorrect
|
||||
// casing
|
||||
if (isWindows || isMacintosh) {
|
||||
args.push('--ignore-case');
|
||||
}
|
||||
|
||||
if (/^refs\/(head|remotes)\//i.test(name)) {
|
||||
args.push(name);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue