From c54c26d82e5054eaa62ce65bc8f7330b48ded485 Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Sun, 6 Oct 2024 12:29:03 -0600 Subject: [PATCH] client/push: Disallow paths on the command line with --stdin --- client/src/command/push.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/src/command/push.rs b/client/src/command/push.rs index fdbc7a1..b2bb661 100644 --- a/client/src/command/push.rs +++ b/client/src/command/push.rs @@ -182,6 +182,12 @@ pub async fn run(opts: Opts) -> Result<()> { }; if sub.stdin { + if !sub.paths.is_empty() { + return Err(anyhow!( + "No paths can be specified on the command line with --stdin" + )); + } + push_ctx.push_stdin().await?; } else { push_ctx.push_static(sub.paths.clone()).await?;