Skip to content

Commit b17935b

Browse files
committed
Fix path formatting; refactor slightly for clarity
Paths of files/blobs with mismatches had been shown literally, even when containing unusual characters, and had been followed by two newlines instead of one. This fixes that, and also includes some small stylistic refactoring.
1 parent 76268f8 commit b17935b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/it/src/commands/check_mode.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@ pub(super) mod function {
8686

8787
match mode {
8888
b"100644" if blob_has_shebang(root, oid)? => {
89-
println!("mode -x but has shebang: {}\n", path);
89+
println!("mode -x but has shebang: {path:?}");
9090
Ok(true)
9191
}
9292
b"100755" if !blob_has_shebang(root, oid)? => {
93-
println!("mode +x but no shebang: {}\n", path);
93+
println!("mode +x but no shebang: {path:?}");
9494
Ok(true)
9595
}
9696
_ => Ok(false),
@@ -114,7 +114,7 @@ pub(super) mod function {
114114
// TODO: Maybe check status? On Unix, it should be 0 or SIGPIPE. Not sure about Windows.
115115
_ = child.wait().context("Failure running `git` subprocess to read blob")?;
116116

117-
let magic = &buf[..count];
118-
Ok(magic == b"#!")
117+
let possible_shebang = &buf[..count];
118+
Ok(possible_shebang == b"#!")
119119
}
120120
}

0 commit comments

Comments
 (0)