From ee4584ffbdf217bb8b31ec8bd6c2a61e12df4857 Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Sun, 16 Nov 2025 11:24:44 -0500 Subject: [PATCH] Compare tree hashes instead of using git diff Comparing tree hashes is more accurate for detecting content differences between the merge commit and PR head, avoiding false positives when the content is identical but commit SHAs differ. --- test_harness.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test_harness.jl b/test_harness.jl index a80db03..1c2da18 100644 --- a/test_harness.jl +++ b/test_harness.jl @@ -25,8 +25,10 @@ if haskey(ENV, "GITHUB_SHA") && get(ENV, "GITHUB_EVENT_NAME", "") == "pull_reque # Check if there's any difference between the merge commit and the PR head # In GitHub Actions, HEAD^2 is the PR head (second parent of merge commit) - # success() returns true if the command exits with 0 (no differences) - has_diff = !success(`git diff --quiet --exit-code HEAD^2 HEAD`) + # Compare tree hashes to check if content actually differs + merge_tree = chomp(read(`git rev-parse HEAD^{tree}`, String)) + pr_tree = chomp(read(`git rev-parse HEAD^2^{tree}`, String)) + has_diff = merge_tree != pr_tree if has_diff base_branch = isempty(base_branch_name) ? "the base branch" : "'$base_branch_name'"