Skip to content

Commit d4b1974

Browse files
zulinx86pb8o
authored andcommitted
test: Fix non-dirty files being reported as dirty
Fixes non-dirty files being reported as dirty. Since the `is_dirty` variable was initialized as 0 outside the for loop, after a dirty file was found, all the subsequent files were also reported as dirty. Initializing it in the every iteration fixes this issue. Signed-off-by: Takahiro Itazuri <[email protected]>
1 parent ea94cc7 commit d4b1974

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.github/workflows/deny_dirty_cargo_locks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
- name: "Check no Cargo.lock files are dirty"
1515
run: |
1616
exit_code=0
17-
is_dirty=0
1817
# This breaks for paths with whitespaces in them, but we have an integration test
1918
# that prevents those from existing in this repository.
2019
for f in $(find . -name 'Cargo.lock' -not -path "./build/*"); do
20+
is_dirty=0
2121
(
2222
cd "$(dirname "$f")"
2323
cargo --locked metadata --format-version 1 >/dev/null 2>&1

0 commit comments

Comments
 (0)