MCPcopy Create free account
hub / github.com/continuedev/continue / getRepoInfo

Function getRepoInfo

extensions/cli/src/ui/hooks/useTUIChatHooks.ts:10–47  ·  view source on GitHub ↗
(remoteUrl?: string)

Source from the content-addressed store, hash-verified

8
9// Helper function to get repo info for responsive display
10export function getRepoInfo(remoteUrl?: string): {
11 repoName: string;
12 branchName: string | null;
13 fullPath: string;
14 isGitRepo: boolean;
15} {
16 let url = remoteUrl ?? "";
17 const isGit = isGitRepo();
18 let branchName: string | null = null;
19
20 if (!url && isGit) {
21 const gitUrl = getGitRemoteUrl();
22 if (gitUrl) {
23 url = gitUrl;
24 }
25 }
26
27 if (!url) {
28 url = process.cwd();
29 }
30
31 // Get branch info if we're in a git repo
32 if (isGit) {
33 branchName = getGitBranch();
34 }
35
36 // Clean up the URL
37 const cleanUrl = url
38 .replace(/\.git$/, "")
39 .replace(/^(https|http):\/\/.*?\//, "");
40
41 return {
42 repoName: cleanUrl,
43 branchName,
44 fullPath: url,
45 isGitRepo: isGit,
46 };
47}
48
49// Helper function to get responsive repo URL text based on available width
50export function getResponsiveRepoText(

Callers 2

getResponsiveRepoTextFunction · 0.85

Calls 4

getGitRemoteUrlFunction · 0.85
getGitBranchFunction · 0.85
isGitRepoFunction · 0.50
replaceMethod · 0.45

Tested by

no test coverage detected