From b0341a0f661a50bf82b49b78a0bad0a76343f77f Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Mon, 30 Oct 2023 00:23:32 -0400 Subject: [PATCH] Fixes descendant spelling --- src/commands/git/worktree.ts | 4 ++-- src/system/path.ts | 12 ++++++------ src/views/nodes/repositoriesNode.ts | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/commands/git/worktree.ts b/src/commands/git/worktree.ts index b90bff3..24f8f72 100644 --- a/src/commands/git/worktree.ts +++ b/src/commands/git/worktree.ts @@ -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; diff --git a/src/system/path.ts b/src/system/path.ts index f3f6bac..446ea24 100644 --- a/src/system/path.ts +++ b/src/system/path.ts @@ -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) { diff --git a/src/views/nodes/repositoriesNode.ts b/src/views/nodes/repositoriesNode.ts index 0c64a7d..32ddb9e 100644 --- a/src/views/nodes/repositoriesNode.ts +++ b/src/views/nodes/repositoriesNode.ts @@ -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;