@@ -872,6 +872,7 @@ export const makeVcsDriverShape = Effect.fn("makeGitVcsDriverShape")(function* (
872872 "--git-common-dir" ,
873873 "--git-path" ,
874874 "index" ,
875+ "--show-prefix" ,
875876 "--verify" ,
876877 "--quiet" ,
877878 "HEAD" ,
@@ -881,19 +882,27 @@ export const makeVcsDriverShape = Effect.fn("makeGitVcsDriverShape")(function* (
881882 const headExists = result . exitCode === 0 ;
882883 const headChecked = headExists || result . exitCode === 1 ;
883884 const lines = result . stdout . split ( "\n" ) ;
884- const [ gitCommonDir = "" , indexPath = "" ] = lines ;
885- if ( headChecked && lines . length === ( headExists ? 4 : 3 ) && lines . at ( - 1 ) === "" ) {
885+ const [ gitCommonDir = "" , indexPath = "" , prefix = "" ] = lines ;
886+ if ( headChecked && lines . length === ( headExists ? 5 : 4 ) && lines . at ( - 1 ) === "" ) {
886887 return {
887888 gitCommonDir : gitCommonDir . trim ( ) ,
888889 indexPath : indexPath . trim ( ) ,
890+ prefix,
889891 headExists,
890892 } ;
891893 }
892894 // Git before 2.31 echoes --path-format, and a path containing a newline spans lines.
893895 // Separate commands read the paths as before and report a failure the same way.
896+ const fallbackCommonDir = yield * resolveGitCommonDir ( cwd ) ;
897+ const prefixResult = yield * execute ( {
898+ operation : VcsProcess . CHECKPOINT_CAPTURE_OPERATION ,
899+ cwd,
900+ args : [ "rev-parse" , "--show-prefix" ] ,
901+ } ) ;
894902 return {
895- gitCommonDir : yield * resolveGitCommonDir ( cwd ) ,
903+ gitCommonDir : fallbackCommonDir ,
896904 indexPath : undefined ,
905+ prefix : prefixResult . stdout . replace ( / \n $ / , "" ) ,
897906 headExists : headChecked ? headExists : yield * hasHeadCommit ( cwd ) ,
898907 } ;
899908 } ) ;
@@ -930,7 +939,9 @@ export const makeVcsDriverShape = Effect.fn("makeGitVcsDriverShape")(function* (
930939 "-c" ,
931940 "splitIndex.sharedIndexExpire=never" ,
932941 ] ;
933- const { gitCommonDir, indexPath, headExists } = yield * resolveCaptureRepository ( input . cwd ) ;
942+ const { gitCommonDir, indexPath, prefix, headExists } = yield * resolveCaptureRepository (
943+ input . cwd ,
944+ ) ;
934945 const indexId = yield * random . uuidV4 ( ) ;
935946 const tempIndexPath = path . join ( gitCommonDir , `t3-checkpoint-index-${ indexId } ` ) ;
936947 const hostEnv = yield * HostProcess . Environment ;
@@ -1123,7 +1134,12 @@ export const makeVcsDriverShape = Effect.fn("makeGitVcsDriverShape")(function* (
11231134 }
11241135 }
11251136
1126- const workspaceIgnored = ( yield * filterIgnoredPaths ( input . cwd , [ "." ] ) ) . length === 0 ;
1137+ // The working-tree root is never ignored. Probe a subdirectory without the trailing slash
1138+ // Git adds to ".", which a blank or whitespace-only ignore line matches as an empty pattern.
1139+ const workspaceIgnored =
1140+ prefix !== "" &&
1141+ ( yield * filterIgnoredPaths ( input . cwd , [ `../${ prefix . slice ( 0 , - 1 ) . split ( "/" ) . at ( - 1 ) } ` ] ) )
1142+ . length === 0 ;
11271143 if ( workspaceIgnored ) {
11281144 // HEAD omits staged-only paths. Seed just this workspace's additions, keeping
11291145 // unrelated staged changes and the scratch index's sparse flags untouched.
0 commit comments