@@ -12,7 +12,7 @@ import * as which from 'which';
12
12
import { EventEmitter } from 'events' ;
13
13
import * as iconv from '@vscode/iconv-lite-umd' ;
14
14
import * as filetype from 'file-type' ;
15
- import { assign , groupBy , IDisposable , toDisposable , dispose , mkdirp , readBytes , detectUnicodeEncoding , Encoding , onceEvent , splitInChunks , Limiter , Versions , isWindows , pathEquals } from './util' ;
15
+ import { assign , groupBy , IDisposable , toDisposable , dispose , mkdirp , readBytes , detectUnicodeEncoding , Encoding , onceEvent , splitInChunks , Limiter , Versions , isWindows , pathEquals , isMacintosh } from './util' ;
16
16
import { CancellationError , CancellationToken , ConfigurationChangeEvent , LogOutputChannel , Progress , Uri , workspace } from 'vscode' ;
17
17
import { detectEncoding } from './encoding' ;
18
18
import { Ref , RefType , Branch , Remote , ForcePushMode , GitErrorCodes , LogOptions , Change , Status , CommitOptions , RefQuery , InitOptions } from './api/git' ;
@@ -2352,6 +2352,13 @@ export class Repository {
2352
2352
args . push ( '--format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref)' ) ;
2353
2353
}
2354
2354
2355
+ // On Windows and macOS ref names are case insensitive so we add --ignore-case
2356
+ // to handle the scenario where the user switched to a branch with incorrect
2357
+ // casing
2358
+ if ( isWindows || isMacintosh ) {
2359
+ args . push ( '--ignore-case' ) ;
2360
+ }
2361
+
2355
2362
if ( / ^ r e f s \/ ( h e a d | r e m o t e s ) \/ / i. test ( name ) ) {
2356
2363
args . push ( name ) ;
2357
2364
} else {
0 commit comments