Browse Source

Allows directories that end with a space

main
Eric Amodio 4 years ago
parent
commit
9a05e0c224
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      src/git/git.ts

+ 2
- 1
src/git/git.ts View File

@ -1037,7 +1037,8 @@ export namespace Git {
'--show-toplevel',
);
// Make sure to normalize: https://github.com/git-for-windows/git/issues/2478
return data.length === 0 ? undefined : Strings.normalizePath(data.trim());
// Keep trailing spaces which are part of the directory name
return data.length === 0 ? undefined : Strings.normalizePath(data.trimLeft().replace(/(\r\n|\r|\n)+$/, ''));
} catch (ex) {
if (ex.code === 'ENOENT') {
// If the `cwd` doesn't exist, walk backward to see if any parent folder exists

Loading…
Cancel
Save