@@ -1551,18 +1551,18 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
15511551 } ) ,
15521552 } ,
15531553 ) ;
1554- const originExistsCache = yield * Cache . makeWith (
1554+ const primaryRemoteExistsCache = yield * Cache . makeWith (
15551555 ( gitCommonDir : string ) =>
15561556 Effect . gen ( function * ( ) {
15571557 const path = yield * Path . Path ;
15581558 const fetchCwd =
15591559 path . basename ( gitCommonDir ) === ".git" ? path . dirname ( gitCommonDir ) : gitCommonDir ;
15601560 return yield * executeGit (
1561- "GitVcsDriver.statusDetails.originExists " ,
1561+ "GitVcsDriver.statusDetails.primaryRemoteExists " ,
15621562 fetchCwd ,
1563- [ "--git-dir" , gitCommonDir , "remote" , "get-url" , "origin" ] ,
1563+ [ "--git-dir" , gitCommonDir , "remote" ] ,
15641564 { allowNonZeroExit : true } ,
1565- ) . pipe ( Effect . map ( ( result ) => result . exitCode === 0 ) ) ;
1565+ ) . pipe ( Effect . map ( ( result ) => result . exitCode === 0 && result . stdout . trim ( ) . length > 0 ) ) ;
15661566 } ) ,
15671567 {
15681568 capacity : 2_048 ,
@@ -1582,7 +1582,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
15821582 : gitCommonDir ;
15831583 const cacheKey = commonDir ?? normalizeRepositoryPathsCacheKey ( cwd ) ;
15841584 yield * Cache . invalidate ( defaultBranchCache , cacheKey ) ;
1585- yield * Cache . invalidate ( originExistsCache , cacheKey ) ;
1585+ yield * Cache . invalidate ( primaryRemoteExistsCache , cacheKey ) ;
15861586 } ,
15871587 ) ;
15881588
@@ -2196,8 +2196,13 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
21962196 ? Cache . get ( defaultBranchCache , statusCacheKey ) . pipe ( Effect . orElseSucceed ( ( ) => null ) )
21972197 : resolveDefaultBranchName ( cwd , "origin" ) . pipe ( Effect . orElseSucceed ( ( ) => null ) ) ,
21982198 statusCacheKey
2199- ? Cache . get ( originExistsCache , statusCacheKey ) . pipe ( Effect . orElseSucceed ( ( ) => false ) )
2200- : originRemoteExists ( cwd ) . pipe ( Effect . orElseSucceed ( ( ) => false ) ) ,
2199+ ? Cache . get ( primaryRemoteExistsCache , statusCacheKey ) . pipe (
2200+ Effect . orElseSucceed ( ( ) => false ) ,
2201+ )
2202+ : listRemoteNames ( cwd ) . pipe (
2203+ Effect . map ( ( remoteNames ) => remoteNames . length > 0 ) ,
2204+ Effect . orElseSucceed ( ( ) => false ) ,
2205+ ) ,
22012206 ] ,
22022207 { concurrency : "unbounded" } ,
22032208 ) ;
@@ -3939,7 +3944,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
39393944 return {
39403945 localBranches : localBranches . toSorted ( byRecencyThenName ) . map ( ( { ref } ) => ref ) ,
39413946 remoteBranches : remoteBranches . toSorted ( byRecencyThenName ) . map ( ( { ref } ) => ref ) ,
3942- hasPrimaryRemote : remoteNames . includes ( "origin" ) ,
3947+ hasPrimaryRemote : remoteNames . length > 0 ,
39433948 } satisfies GitRefsSnapshot ;
39443949 } ) ;
39453950
0 commit comments