@@ -281,18 +281,24 @@ it.effect("checkpoint recovery discovers nested HEAD independently of inherited
281281 const cwd = yield * fs . makeTempDirectoryScoped ( { prefix : "t3-checkpoint-git-dir-" } ) ;
282282 const { git, checkpointRef } = yield * makeCheckpointFixture ( driver , cwd ) ;
283283 yield * git ( [ "init" , "empty" ] ) ;
284+ yield * git ( [ "config" , "core.sharedRepository" , "group" ] ) ;
284285 const originalIndex = yield * fs . readFile ( path . join ( cwd , ".git" , "index" ) ) ;
285286 yield * fs . makeDirectory ( path . join ( cwd , "inherited-objects" ) ) ;
286287 yield * Effect . acquireUseRelease (
287288 Effect . sync ( ( ) => {
288- const previous = { gitDir : process . env . GIT_DIR , objects : process . env . GIT_OBJECT_DIRECTORY } ;
289+ const previous = {
290+ gitDir : process . env . GIT_DIR ,
291+ objects : process . env . GIT_OBJECT_DIRECTORY ,
292+ umask : process . umask ( 0o022 ) ,
293+ } ;
289294 process . env . GIT_DIR = path . join ( cwd , ".git" ) ;
290295 process . env . GIT_OBJECT_DIRECTORY = path . join ( cwd , "inherited-objects" ) ;
291296 return previous ;
292297 } ) ,
293298 ( ) => driver . checkpoints . captureCheckpoint ( { cwd, checkpointRef } ) ,
294299 ( previous ) =>
295300 Effect . sync ( ( ) => {
301+ process . umask ( previous . umask ) ;
296302 if ( previous . gitDir === undefined ) delete process . env . GIT_DIR ;
297303 else process . env . GIT_DIR = previous . gitDir ;
298304 if ( previous . objects === undefined ) delete process . env . GIT_OBJECT_DIRECTORY ;
@@ -302,6 +308,11 @@ it.effect("checkpoint recovery discovers nested HEAD independently of inherited
302308 assert . strictEqual ( ( yield * git ( [ "show" , `${ checkpointRef } :file.txt` ] ) ) . stdout , "unstaged\n" ) ;
303309 assert . strictEqual ( ( yield * git ( [ "ls-tree" , "-r" , checkpointRef , "--" , "empty" ] ) ) . stdout , "" ) ;
304310 assert . deepEqual ( yield * fs . readFile ( path . join ( cwd , ".git" , "index" ) ) , originalIndex ) ;
311+ if ( ( yield * HostProcess . Platform ) !== "win32" ) {
312+ const blob = ( yield * git ( [ "rev-parse" , `${ checkpointRef } :file.txt` ] ) ) . stdout . trim ( ) ;
313+ const fanout = yield * fs . stat ( path . join ( cwd , ".git" , "objects" , blob . slice ( 0 , 2 ) ) ) ;
314+ assert . strictEqual ( fanout . mode & 0o020 , 0o020 ) ;
315+ }
305316 } ) . pipe ( Effect . scoped , Effect . provide ( layerGitContract ) ) ,
306317) ;
307318
0 commit comments