Skip to content

Commit bf3055e

Browse files
committed
try this debug info
1 parent 428ad66 commit bf3055e

File tree

2 files changed

+45
-2
lines changed

2 files changed

+45
-2
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- run: pnpm build
3232
- run: pnpm lint
3333
- run: pnpm format:check
34-
- run: pnpm test:integration
34+
- run: pnpm test:integration -- --testPathPattern="git"
3535
env:
3636
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3737
HEAD_OID: ${{ github.base_ref }}

src/test/integration/git.test.ts

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)