Skip to content

Commit 961b74b

Browse files
committed
Add index to name of refactor diff files to keep track of order of application
1 parent 4b1498b commit 961b74b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/templates.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,16 @@
6363
rm -rf "$ARTIFACT_DIR"
6464
mkdir -p "$ARTIFACT_DIR"
6565
66+
diff_idx=0
6667
while IFS= read -r transform; do
6768
[[ -z "$transform" ]] && continue
68-
DIFF_FILE="$ARTIFACT_DIR/${transform}.diff"
69+
70+
# Print the index in 4 digit format with leading zeroes,
71+
# so the indices align just like in git outputs
72+
diff_idx4=`printf "%04d" "${diff_idx}"`
73+
: $((diff_idx++))
74+
75+
DIFF_FILE="$ARTIFACT_DIR/${diff_idx4}_${transform}.diff"
6976
7077
c2rust-refactor \
7178
${transform} \

0 commit comments

Comments
 (0)