@@ -364,7 +364,7 @@ describe("git", () => {
364364 } ) ;
365365 }
366366
367- it ( `should allow unchanged symlinks without throwing` , async ( ) => {
367+ it . only ( `should allow unchanged symlinks without throwing` , async ( ) => {
368368 const branch = `${ TEST_BRANCH_PREFIX } -unchanged-symlink` ;
369369 branches . push ( branch ) ;
370370
@@ -390,6 +390,49 @@ describe("git", () => {
390390
391391 await makeFileChanges ( repoDirectory , "with-unchanged-symlink" ) ;
392392
393+ // DEBUG: Log symlink state before calling commitChangesFromRepo
394+ const headOid = (
395+ await git . log ( { fs, dir : repoDirectory , ref : "HEAD" , depth : 1 } )
396+ ) [ 0 ] ?. oid ;
397+ console . log ( "DEBUG: HEAD oid:" , headOid ) ;
398+
399+ // Check symlink in filesystem
400+ const symlinkPath = path . join ( repoDirectory , "some-dir" , "nested" ) ;
401+ const symlinkTarget = await fs . promises . readlink ( symlinkPath ) ;
402+ const symlinkStat = await fs . promises . lstat ( symlinkPath ) ;
403+ console . log ( "DEBUG: Symlink target from fs.readlink:" , symlinkTarget ) ;
404+ console . log (
405+ "DEBUG: Symlink isSymbolicLink:" ,
406+ symlinkStat . isSymbolicLink ( ) ,
407+ ) ;
408+
409+ // Walk the tree to compare oids
410+ const trees = [ git . TREE ( { ref : headOid ! } ) , git . WORKDIR ( ) ] ;
411+ await git . walk ( {
412+ fs,
413+ dir : repoDirectory ,
414+ trees,
415+ map : async ( filepath , [ commit , workdir ] ) => {
416+ if ( filepath === "some-dir/nested" ) {
417+ const commitOid = await commit ?. oid ( ) ;
418+ const workdirOid = await workdir ?. oid ( ) ;
419+ const commitMode = await commit ?. mode ( ) ;
420+ const workdirMode = await workdir ?. mode ( ) ;
421+ const commitType = await commit ?. type ( ) ;
422+ const workdirType = await workdir ?. type ( ) ;
423+ console . log ( "DEBUG: filepath:" , filepath ) ;
424+ console . log ( "DEBUG: commit oid:" , commitOid ) ;
425+ console . log ( "DEBUG: workdir oid:" , workdirOid ) ;
426+ console . log ( "DEBUG: oids match:" , commitOid === workdirOid ) ;
427+ console . log ( "DEBUG: commit mode:" , commitMode ?. toString ( 8 ) ) ;
428+ console . log ( "DEBUG: workdir mode:" , workdirMode ?. toString ( 8 ) ) ;
429+ console . log ( "DEBUG: commit type:" , commitType ) ;
430+ console . log ( "DEBUG: workdir type:" , workdirType ) ;
431+ }
432+ return true ;
433+ } ,
434+ } ) ;
435+
393436 // The symlink was committed locally and is unchanged in workdir.
394437 // The tree walk should skip it since oids match.
395438 // GitHub push may fail because local commit doesn't exist on GitHub,
0 commit comments