upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/grasp-audit/src/specs/grasp01
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2026-02-13 09:09:59 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2026-02-13 09:09:59 +0000
commitfaac6027deaf5f1e121c05df2d8a6336fd6eaf8d (patch)
tree57080ce5a41edf7362ce569dd86c8ae38a3624cc /grasp-audit/src/specs/grasp01
parent8fc4078d60f0ccf16318fe7fa765fcdd3627fe1f (diff)
fix: add trailing newlines to deterministic commit content
The CommitVariant::file_content() methods were returning strings without trailing newlines, but the expected hash constants were calculated with trailing newlines. This caused hash mismatches in tests. Updated all hash constants to match the actual commit hashes produced with trailing newlines in the file content.
Diffstat (limited to 'grasp-audit/src/specs/grasp01')
-rw-r--r--grasp-audit/src/specs/grasp01/push_authorization.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/grasp-audit/src/specs/grasp01/push_authorization.rs b/grasp-audit/src/specs/grasp01/push_authorization.rs
index 78ef471..dc78b49 100644
--- a/grasp-audit/src/specs/grasp01/push_authorization.rs
+++ b/grasp-audit/src/specs/grasp01/push_authorization.rs
@@ -19,7 +19,7 @@
19/// Expected hash for PR test deterministic commit 19/// Expected hash for PR test deterministic commit
20/// 20///
21/// This hash is produced by creating a commit with: 21/// This hash is produced by creating a commit with:
22/// - File: test.txt containing "PR test deterministic commit" 22/// - File: test.txt containing "PR test deterministic commit\n" (with trailing newline)
23/// - Message: "PR test deterministic commit" 23/// - Message: "PR test deterministic commit"
24/// - Author: "GRASP Audit Test <test@grasp-audit.local>" 24/// - Author: "GRASP Audit Test <test@grasp-audit.local>"
25/// - Author date: 2024-01-01T00:00:00Z 25/// - Author date: 2024-01-01T00:00:00Z
@@ -29,7 +29,7 @@
29/// 29///
30/// Run `test_pr_test_commit_hash_discovery` to discover/verify this value. 30/// Run `test_pr_test_commit_hash_discovery` to discover/verify this value.
31#[allow(dead_code)] 31#[allow(dead_code)]
32const PR_TEST_COMMIT_HASH: &str = "5d40fb1555a0c28bf4d650515a73aaa54d4d9bfb"; 32const PR_TEST_COMMIT_HASH: &str = "5a51b30e4615b572dcd5b9e487861b58605a5c21";
33 33
34use crate::specs::grasp01::SpecRef; 34use crate::specs::grasp01::SpecRef;
35use crate::{ 35use crate::{
@@ -1722,9 +1722,9 @@ mod tests {
1722 .expect("git config name failed"); 1722 .expect("git config name failed");
1723 assert!(output.status.success(), "git config name failed"); 1723 assert!(output.status.success(), "git config name failed");
1724 1724
1725 // Create the deterministic file content 1725 // Create the deterministic file content (must match CommitVariant::PRTestCommit exactly)
1726 let test_file = path.join("test.txt"); 1726 let test_file = path.join("test.txt");
1727 fs::write(&test_file, "PR test deterministic commit").expect("Failed to write test file"); 1727 fs::write(&test_file, "PR test deterministic commit\n").expect("Failed to write test file");
1728 1728
1729 // Add the file 1729 // Add the file
1730 let output = Command::new("git") 1730 let output = Command::new("git")