diff options
Diffstat (limited to 'packages/server/src')
-rw-r--r-- | packages/server/src/git/http.ts | 1 | ||||
-rw-r--r-- | packages/server/src/git/patch.ts | 4 | ||||
-rw-r--r-- | packages/server/src/git/repository.ts | 4 |
3 files changed, 5 insertions, 4 deletions
diff --git a/packages/server/src/git/http.ts b/packages/server/src/git/http.ts index c2654e7..183c6df 100644 --- a/packages/server/src/git/http.ts +++ b/packages/server/src/git/http.ts @@ -3,6 +3,7 @@ import { Repository } from "./repository"; import { Route } from "../types/fastify"; import { join } from "path"; import { spawn } from "child_process"; +import { URL } from "url"; export interface Request extends FastifyRequest { params: Route["Params"], diff --git a/packages/server/src/git/patch.ts b/packages/server/src/git/patch.ts index 45ffe23..4239ce4 100644 --- a/packages/server/src/git/patch.ts +++ b/packages/server/src/git/patch.ts @@ -130,12 +130,12 @@ export class Patch { * * @returns An array of hunk instances */ - public async getHunks(): Promise<Hunk[] | null> { + public async getHunks(): Promise<Hunk[]> { const content = (await this._content()).split("\n"); const hunks = await this._ng_patch.hunks(); if(hunks.length === 0) { - return null; + return []; } const hunks_data = hunks.reduce((result: Hunks, hunk, hunk_index) => { diff --git a/packages/server/src/git/repository.ts b/packages/server/src/git/repository.ts index 4250af0..ccc8bcc 100644 --- a/packages/server/src/git/repository.ts +++ b/packages/server/src/git/repository.ts @@ -183,11 +183,11 @@ export class Repository { * @param base_dir - The directory that contains the repositories * @returns An array of repository instances */ - public static async openAll(base_dir: string): Promise<Repository[] | null> { + public static async openAll(base_dir: string): Promise<Repository[]> { const dir_content = await getDirectory(base_dir); if(dir_content.length === 0) { - return null; + return []; } const repositories = dir_content.filter(dir_entry => dir_entry.endsWith(".git")); |