From 77ee2d36a8d72341c50919c95dde14496b12a85b Mon Sep 17 00:00:00 2001 From: Andrei Homescu Date: Tue, 18 Nov 2025 19:21:38 -0800 Subject: [PATCH] Add index to name of refactor diff files to keep track of order of application --- tests/templates.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/templates.py b/tests/templates.py index 478b2b5..820f675 100644 --- a/tests/templates.py +++ b/tests/templates.py @@ -63,9 +63,16 @@ rm -rf "$ARTIFACT_DIR" mkdir -p "$ARTIFACT_DIR" +diff_idx=0 while IFS= read -r transform; do [[ -z "$transform" ]] && continue - DIFF_FILE="$ARTIFACT_DIR/${transform}.diff" + + # Print the index in 4 digit format with leading zeroes, + # so the indices align just like in git outputs + diff_idx4=`printf "%04d" "${diff_idx}"` + : $((diff_idx++)) + + DIFF_FILE="$ARTIFACT_DIR/${diff_idx4}_${transform}.diff" c2rust-refactor \ ${transform} \