aboutsummaryrefslogtreecommitdiff
path: root/packages/server/src/api/v1.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/server/src/api/v1.ts')
-rw-r--r--packages/server/src/api/v1.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/packages/server/src/api/v1.ts b/packages/server/src/api/v1.ts
index 216d33d..b0e595d 100644
--- a/packages/server/src/api/v1.ts
+++ b/packages/server/src/api/v1.ts
@@ -121,6 +121,11 @@ export default function(fastify: FastifyInstance, opts: FastifyPluginOptions, do
url: "/branches/:branch",
handler: async(req, reply) => {
const params: any = req.params;
+ const branch_verification = await verifySHA(git, params.repo, params.branch);
+ if(branch_verification.success === false && branch_verification.code) {
+ reply.code(branch_verification.code).send({ error: branch_verification.message });
+ }
+
const branch = await git.getBranch(params.repo, params.branch);
if(!branch) {