File tree Expand file tree Collapse file tree 3 files changed +46
-4
lines changed
Expand file tree Collapse file tree 3 files changed +46
-4
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ export function BackendChatHeader({
109109 // REMINDER: KEEP UP TO DATE WITH app_handlers.ts
110110 const versionPostfix = versions . length === 100_000 ? `+` : "" ;
111111
112- const isNotMainBranch = branchInfo && branchInfo . branch !== "main" ;
112+ const isNotMainBranch = branchInfo && branchInfo . branch !== "main" && branchInfo . branch !== "<no-git-repo>" ;
113113
114114 const currentBranchName = branchInfo ?. branch ;
115115
@@ -160,7 +160,27 @@ export function BackendChatHeader({
160160 </ TooltipProvider >
161161 </ >
162162 ) }
163- { currentBranchName && currentBranchName !== "<no-branch>" && (
163+ { currentBranchName === "<no-git-repo>" && (
164+ < >
165+ < TooltipProvider >
166+ < Tooltip >
167+ < TooltipTrigger asChild >
168+ < span className = "flex items-center gap-1" >
169+ < strong > Info:</ strong >
170+ < span > Version control not initialized</ span >
171+ < Info size = { 14 } />
172+ </ span >
173+ </ TooltipTrigger >
174+ < TooltipContent >
175+ < p >
176+ This app does not have git version control initialized yet.
177+ </ p >
178+ </ TooltipContent >
179+ </ Tooltip >
180+ </ TooltipProvider >
181+ </ >
182+ ) }
183+ { currentBranchName && currentBranchName !== "<no-branch>" && currentBranchName !== "<no-git-repo>" && (
164184 < span >
165185 You are on branch: < strong > { currentBranchName } </ strong > .
166186 </ span >
Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ export function ChatHeader({
108108 // REMINDER: KEEP UP TO DATE WITH app_handlers.ts
109109 const versionPostfix = versions . length === 100_000 ? `+` : "" ;
110110
111- const isNotMainBranch = branchInfo && branchInfo . branch !== "main" ;
111+ const isNotMainBranch = branchInfo && branchInfo . branch !== "main" && branchInfo . branch !== "<no-git-repo>" ;
112112
113113 const currentBranchName = branchInfo ?. branch ;
114114
@@ -153,6 +153,26 @@ export function ChatHeader({
153153 </ TooltipProvider >
154154 </ >
155155 ) }
156+ { currentBranchName === "<no-git-repo>" && (
157+ < >
158+ < TooltipProvider >
159+ < Tooltip >
160+ < TooltipTrigger asChild >
161+ < span className = "flex items-center gap-1" >
162+ < strong > Info:</ strong >
163+ < span > Version control not initialized</ span >
164+ < Info size = { 14 } />
165+ </ span >
166+ </ TooltipTrigger >
167+ < TooltipContent >
168+ < p >
169+ This app does not have git version control initialized yet.
170+ </ p >
171+ </ TooltipContent >
172+ </ Tooltip >
173+ </ TooltipProvider >
174+ </ >
175+ ) }
156176 { currentBranchName && currentBranchName !== "<no-branch>" && (
157177 < span >
158178 You are on branch: < strong > { currentBranchName } </ strong > .
Original file line number Diff line number Diff line change @@ -129,7 +129,9 @@ export function registerVersionHandlers() {
129129
130130 // Return appropriate result if the app is not a git repo
131131 if ( ! fs . existsSync ( path . join ( appPath , ".git" ) ) ) {
132- throw new Error ( "Not a git repository" ) ;
132+ return {
133+ branch : "<no-git-repo>" ,
134+ } ;
133135 }
134136
135137 try {
You can’t perform that action at this time.
0 commit comments