Skip to content

Commit f291437

Browse files
committed
assure that whitespace can't be used to mask command-line arguments in file:// invocations
This also means that directory names can't start with a `-` out of principle, at least when trying to locally fetch from them.
1 parent 5a0d93e commit f291437

File tree

1 file changed

+1
-1
lines changed
  • gix-transport/src/client/blocking_io

1 file changed

+1
-1
lines changed

gix-transport/src/client/blocking_io/file.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ impl client::Transport for SpawnProcessOnDemand {
216216
};
217217
cmd.stdin = Stdio::piped();
218218
cmd.stdout = Stdio::piped();
219-
if self.path.first() == Some(&b'-') {
219+
if self.path.trim().first() == Some(&b'-') {
220220
return Err(client::Error::AmbiguousPath {
221221
path: self.path.clone(),
222222
});

0 commit comments

Comments
 (0)