Przeglądaj źródła

Fixes descendant spelling

main
Eric Amodio 1 rok temu
rodzic
commit
b0341a0f66
3 zmienionych plików z 9 dodań i 9 usunięć
  1. +2
    -2
      src/commands/git/worktree.ts
  2. +6
    -6
      src/system/path.ts
  3. +1
    -1
      src/views/nodes/repositoriesNode.ts

+ 2
- 2
src/commands/git/worktree.ts Wyświetl plik

@ -21,7 +21,7 @@ import { Directive } from '../../quickpicks/items/directive';
import type { FlagsQuickPickItem } from '../../quickpicks/items/flags';
import { createFlagsQuickPickItem } from '../../quickpicks/items/flags';
import { configuration } from '../../system/configuration';
import { basename, isDescendent } from '../../system/path';
import { basename, isDescendant } from '../../system/path';
import { pluralize, truncateLeft } from '../../system/string';
import { openWorkspace } from '../../system/utils';
import type { ViewsWithRepositoryFolders } from '../../views/viewBase';
@ -586,7 +586,7 @@ export class WorktreeGitCommand extends QuickCommand {
const trailer = `${basename(repoUri.path)}.worktrees`;
if (repoUri.toString() !== pickedUri.toString()) {
if (isDescendent(pickedUri, repoUri)) {
if (isDescendant(pickedUri, repoUri)) {
recommendedRootUri = Uri.joinPath(repoUri, '..', trailer);
} else if (basename(pickedUri.path) === trailer) {
recommendedRootUri = pickedUri;

+ 6
- 6
src/system/path.ts Wyświetl plik

@ -101,7 +101,7 @@ export function isChild(pathOrUri: string | Uri, base: string | Uri): boolean {
}
return (
isDescendent(pathOrUri, base) &&
isDescendant(pathOrUri, base) &&
(typeof pathOrUri === 'string' ? pathOrUri : pathOrUri.path)
.substr(base.length + (base.charCodeAt(base.length - 1) === slash ? 0 : 1))
.split('/').length === 1
@ -109,17 +109,17 @@ export function isChild(pathOrUri: string | Uri, base: string | Uri): boolean {
}
return (
isDescendent(pathOrUri, base) &&
isDescendant(pathOrUri, base) &&
(typeof pathOrUri === 'string' ? pathOrUri : pathOrUri.path)
.substr(base.path.length + (base.path.charCodeAt(base.path.length - 1) === slash ? 0 : 1))
.split('/').length === 1
);
}
export function isDescendent(path: string, base: string | Uri): boolean;
export function isDescendent(uri: Uri, base: string | Uri): boolean;
export function isDescendent(pathOrUri: string | Uri, base: string | Uri): boolean;
export function isDescendent(pathOrUri: string | Uri, base: string | Uri): boolean {
export function isDescendant(path: string, base: string | Uri): boolean;
export function isDescendant(uri: Uri, base: string | Uri): boolean;
export function isDescendant(pathOrUri: string | Uri, base: string | Uri): boolean;
export function isDescendant(pathOrUri: string | Uri, base: string | Uri): boolean {
if (typeof base === 'string') {
base = normalizePath(base);
if (base.charCodeAt(0) !== slash) {

+ 1
- 1
src/views/nodes/repositoriesNode.ts Wyświetl plik

@ -136,7 +136,7 @@ export class RepositoriesNode extends SubscribeableViewNode<
| undefined;
if (node == null) return;
// Check to see if this repo has a descendent that is already selected
// Check to see if this repo has a descendant that is already selected
let parent = this.view.selection.length === 0 ? undefined : this.view.selection[0];
while (parent != null) {
if (parent === node) return;

Ładowanie…
Anuluj
Zapisz