Skip to content

Commit 21213b7

Browse files
remove unlink method from FsClient
1 parent b26109d commit 21213b7

41 files changed

Lines changed: 19 additions & 129 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "git-essentials",
3-
"version": "0.6.2",
3+
"version": "0.6.3",
44
"description": "A collection of essential Git commands for your browser and Node.js",
55
"main": "dist/esm/index.js",
66
"types": "index.d.ts",

src/api/merge.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export type MergeResult = {
8282
* ## Limitations
8383
*
8484
* Currently it does not support incomplete merges. That is, if there are merge conflicts it cannot solve
85-
* with the built in diff3 algorithm it will not modify the working dir, and will throw a {@link MergeNotSupportedError} error.
85+
* with the built in diff3 algorithm it will not modify the working dir, and will throw a {@link Errors.MergeNotSupportedError} error.
8686
*
8787
* Currently it will fail if multiple candidate merge bases are found. (It doesn't yet implement the recursive merge strategy.)
8888
*

src/clients/fs/InMemoryFsClient.ts

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ type Stats = {
3333
}
3434

3535
class StatsImpl implements StatsLike {
36-
type: 'file' | 'dir' | 'symlink'
36+
private type: 'file' | 'dir' | 'symlink'
3737
mode: number
3838
size: number
3939
ino: number
@@ -188,20 +188,6 @@ export class InMemoryFsClient implements FsClient {
188188
}
189189
}
190190

191-
public async unlink(path: string): Promise<void> {
192-
const { folder, entry, entryName } = this.parsePath(path)
193-
194-
if (!entry) {
195-
throw new ENOENT(path)
196-
}
197-
198-
if (entry.type === 'dir') {
199-
throw new ENOENT(path)
200-
}
201-
202-
folder.children = folder.children.filter(x => x.name !== entryName)
203-
}
204-
205191
public async readdir(path: string): Promise<string[]> {
206192
const { entry } = this.parsePath(path)
207193

src/commands/checkout.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ export async function _checkout({
181181
if (method === 'rmdir-index') {
182182
index.delete({ filepath: fullpath })
183183
}
184-
await fs.rmdir(filepath)
184+
await fs.rm(filepath)
185185
if (onProgress) {
186186
await onProgress({
187187
phase: 'Updating workdir',

src/commands/clone.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export async function _clone({
110110
} catch (err: any) {
111111
if (!(err instanceof AlreadyExistsError)) {
112112
// Remove partial local repository
113-
await fs.rmdir(gitdir, { recursive: true }).catch(() => undefined)
113+
await fs.rm(gitdir, { recursive: true }).catch(() => undefined)
114114
}
115115

116116
throw err

src/errors/AlreadyExistsError.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ export type AlreadyExistsErrorData = {
88
canForce: boolean
99
}
1010

11-
/**
12-
* @group Errors
13-
*/
1411
export class AlreadyExistsError extends BaseError<AlreadyExistsErrorData> {
1512
public static readonly code = 'AlreadyExistsError'
1613

src/errors/BaseError.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ export type ErrorDto<T> = {
66
stack?: string
77
}
88

9-
/**
10-
* @group Errors
11-
*/
129
export class BaseError<T> extends Error {
1310
caller: string
1411

src/errors/CheckoutConflictError.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ export type CheckoutConflictErrorData = {
44
filepaths: string[]
55
}
66

7-
/**
8-
* @group Errors
9-
*/
107
export class CheckoutConflictError extends BaseError<CheckoutConflictErrorData> {
118
public static readonly code = 'CheckoutConflictError'
129

src/errors/CommitNotFetchedError.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ export type CommitNotFetchedErrorData = {
55
oid: string
66
}
77

8-
/**
9-
* @group Errors
10-
*/
118
export class CommitNotFetchedError extends BaseError<CommitNotFetchedErrorData> {
129
public static readonly code = 'CommitNotFetchedError'
1310

0 commit comments

Comments
 (0)