Skip to content

Commit c76681a

Browse files
authored
fix: ensure isNewRepo does not match new Gists
1 parent a359e5b commit c76681a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,7 @@ export const canUserAdminRepo = (): boolean => isRepo() && exists('.reponav-item
756756
/** @deprecated Use `canUserAdminRepo` */
757757
export const canUserEditRepo = canUserAdminRepo;
758758

759-
export const isNewRepo = (url: URL | HTMLAnchorElement | Location = location): boolean => url.pathname === '/new' || /^organizations\/[^/]+\/repositories\/new$/.test(getCleanPathname(url));
759+
export const isNewRepo = (url: URL | HTMLAnchorElement | Location = location): boolean => !isGist(url) && (url.pathname === '/new' || /^organizations\/[^/]+\/repositories\/new$/.test(getCleanPathname(url)));
760760
TEST: addTests('isNewRepo', [
761761
'https://github.com/new',
762762
'https://github.com/organizations/npmhub/repositories/new',

0 commit comments

Comments
 (0)