@@ -338,16 +338,15 @@ def _get_default_bash_path(cls):
338
338
# with Git LFS, where Git LFS may be installed in Windows but not
339
339
# in WSL.
340
340
if not is_win :
341
- return ' bash'
341
+ return " bash"
342
342
try :
343
- wheregit = run (['where' , Git .GIT_PYTHON_GIT_EXECUTABLE ],
344
- check = True , stdout = PIPE ).stdout
343
+ wheregit = run (["where" , Git .GIT_PYTHON_GIT_EXECUTABLE ], check = True , stdout = PIPE ).stdout
345
344
except CalledProcessError :
346
- return ' bash.exe'
345
+ return " bash.exe"
347
346
gitpath = Path (wheregit .decode (defenc ).splitlines ()[0 ])
348
347
gitroot = gitpath .parent .parent
349
- gitbash = gitroot / ' bin' / ' bash.exe'
350
- return str (gitbash ) if gitbash .exists () else ' bash.exe'
348
+ gitbash = gitroot / " bin" / " bash.exe"
349
+ return str (gitbash ) if gitbash .exists () else " bash.exe"
351
350
352
351
@classmethod
353
352
def refresh_bash (cls , path : Union [None , PathLike ] = None ) -> bool :
@@ -370,24 +369,21 @@ def refresh_bash(cls, path: Union[None, PathLike] = None) -> bool:
370
369
# executed for whatever reason.
371
370
has_bash = False
372
371
try :
373
- run ([cls .GIT_PYTHON_BASH_EXECUTABLE , '--version' ],
374
- check = True , stdout = PIPE )
372
+ run ([cls .GIT_PYTHON_BASH_EXECUTABLE , "--version" ], check = True , stdout = PIPE )
375
373
has_bash = True
376
374
except CalledProcessError :
377
375
pass
378
376
379
377
# Warn or raise exception if test failed.
380
378
if not has_bash :
381
- err = (
382
- dedent (
383
- f"""\
379
+ err = dedent (
380
+ f"""\
384
381
Bad bash executable.
385
382
The bash executable must be specified in one of the following ways:
386
383
- be included in your $PATH
387
384
- be set via ${ cls ._bash_exec_env_var }
388
385
- explicitly set via git.refresh_bash()
389
386
"""
390
- )
391
387
)
392
388
393
389
# Revert to whatever the old_bash was.
0 commit comments