File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 11import { HUB_URL } from "../consts" ;
22import { createApiError } from "../error" ;
33import type { AccessToken , RepoDesignation } from "../types/public" ;
4+ import { toRepoId } from "../utils/toRepoId" ;
45
56export async function createBranch ( params : {
67 repo : RepoDesignation ;
@@ -29,7 +30,7 @@ export async function createBranch(params: {
2930 overwrite ?: boolean ;
3031} ) : Promise < void > {
3132 const res = await ( params . fetch ?? fetch ) (
32- `${ params . hubUrl ?? HUB_URL } /api/repos/${ params . repo } /branch/${ encodeURIComponent ( params . branch ) } ` ,
33+ `${ params . hubUrl ?? HUB_URL } /api/repos/${ toRepoId ( params . repo ) } /branch/${ encodeURIComponent ( params . branch ) } ` ,
3334 {
3435 method : "POST" ,
3536 headers : {
Original file line number Diff line number Diff line change 11import { HUB_URL } from "../consts" ;
22import { createApiError } from "../error" ;
33import type { AccessToken , RepoDesignation } from "../types/public" ;
4+ import { toRepoId } from "../utils/toRepoId" ;
45
56export async function deleteBranch ( params : {
67 repo : RepoDesignation ;
@@ -13,7 +14,7 @@ export async function deleteBranch(params: {
1314 fetch ?: typeof fetch ;
1415} ) : Promise < void > {
1516 const res = await ( params . fetch ?? fetch ) (
16- `${ params . hubUrl ?? HUB_URL } /api/repos/${ params . repo } /branch/${ encodeURIComponent ( params . branch ) } ` ,
17+ `${ params . hubUrl ?? HUB_URL } /api/repos/${ toRepoId ( params . repo ) } /branch/${ encodeURIComponent ( params . branch ) } ` ,
1718 {
1819 method : "DELETE" ,
1920 headers : {
You can’t perform that action at this time.
0 commit comments