@@ -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,46 @@ 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 ( "DEBUG: Symlink isSymbolicLink:" , symlinkStat . isSymbolicLink ( ) ) ;
405+
406+ // Walk the tree to compare oids
407+ const trees = [ git . TREE ( { ref : headOid ! } ) , git . WORKDIR ( ) ] ;
408+ await git . walk ( {
409+ fs,
410+ dir : repoDirectory ,
411+ trees,
412+ map : async ( filepath , [ commit , workdir ] ) => {
413+ if ( filepath === "some-dir/nested" ) {
414+ const commitOid = await commit ?. oid ( ) ;
415+ const workdirOid = await workdir ?. oid ( ) ;
416+ const commitMode = await commit ?. mode ( ) ;
417+ const workdirMode = await workdir ?. mode ( ) ;
418+ const commitType = await commit ?. type ( ) ;
419+ const workdirType = await workdir ?. type ( ) ;
420+ console . log ( "DEBUG: filepath:" , filepath ) ;
421+ console . log ( "DEBUG: commit oid:" , commitOid ) ;
422+ console . log ( "DEBUG: workdir oid:" , workdirOid ) ;
423+ console . log ( "DEBUG: oids match:" , commitOid === workdirOid ) ;
424+ console . log ( "DEBUG: commit mode:" , commitMode ?. toString ( 8 ) ) ;
425+ console . log ( "DEBUG: workdir mode:" , workdirMode ?. toString ( 8 ) ) ;
426+ console . log ( "DEBUG: commit type:" , commitType ) ;
427+ console . log ( "DEBUG: workdir type:" , workdirType ) ;
428+ }
429+ return true ;
430+ } ,
431+ } ) ;
432+
393433 // The symlink was committed locally and is unchanged in workdir.
394434 // The tree walk should skip it since oids match.
395435 // GitHub push may fail because local commit doesn't exist on GitHub,
0 commit comments